I try to create a new webb site using VS 2010 and .Net Framework 4.0, I wanted it to be a copy of an exsisting .Net Framework 3.5 based site, so I copied the aspx page code and the codebehind code from the old version when I created the new one, but now
I get these errors...
is not declared. It may be inaccessible due to its protection level.
It seem I get this error on every control I have on the page, why is that and how do I fix it?
Ok, I found the problem. The error occured beacuse I created a new web application, but the aspx pages I copied into that project came from a website project.
modig
Member
475 Points
420 Posts
is not declared. It may be inaccessible due to its protection level.
Apr 16, 2010 01:41 PM|LINK
Hi
I try to create a new webb site using VS 2010 and .Net Framework 4.0, I wanted it to be a copy of an exsisting .Net Framework 3.5 based site, so I copied the aspx page code and the codebehind code from the old version when I created the new one, but now I get these errors...
is not declared. It may be inaccessible due to its protection level.
It seem I get this error on every control I have on the page, why is that and how do I fix it?
arefinn
Contributor
4992 Points
750 Posts
Re: is not declared. It may be inaccessible due to its protection level.
Apr 16, 2010 04:51 PM|LINK
Please post your code.
modig
Member
475 Points
420 Posts
Re: is not declared. It may be inaccessible due to its protection level.
Apr 16, 2010 08:13 PM|LINK
Ok, I found the problem. The error occured beacuse I created a new web application, but the aspx pages I copied into that project came from a website project.
oisinmac
Member
4 Points
4 Posts
Re: is not declared. It may be inaccessible due to its protection level.
Sep 21, 2010 09:30 AM|LINK
Hi, could you please explain why this caused the error andthe steps you took to resolve it?
Many thanks
Managing Director
http://www.marbellaconsulting.com/
modig
Member
475 Points
420 Posts
Re: is not declared. It may be inaccessible due to its protection level.
Oct 20, 2010 01:12 PM|LINK
The pages differ a bit, for example a webb application aspx page have this structure...
CodeBehind="MyPage.aspx.vb" Inherits="WebSite.MyPage"
And In codebehind..
Public Class MyPage
But a website aspx page looks like this..
CodeFile="MyPage.aspx.vb" Inherits="MyPage" %>
And codebehind...
Partial Class myPage