Last post Mar 07, 2006 07:27 PM by ScottGu
Mar 07, 2006 09:38 AM|RDF|LINK
Ok, I've converted a project from 2003 to 2005 and I get 5 errors, all being the same but with a different name in the property area, ex:
ERROR: The member declaration for 'lblTitleName' was removed and its accessibility has been changed from 'public' to 'protected'. To access this member from another page you should create a public accessor property for it. controls\AM_Header.ascx.cs
So no big deal here, all I have to do is make public properties for this and change the code in the appropriate areas and I'll be fine. But my question is, how do I view the base class which 2005 created for all my pages? This article
http://webproject.scottgu.com/CSharp/UnderstandingCodeBehind/UnderstandingCodeBehind.aspx shows that there should be a 'PageName.aspx.designer.cs' file which is where that code is kept, but my VS 2005 doesn't show that. I just see a .aspx page and a .aspx.resx
Can anyone tell me how to get these files to appear on the Solution Explorer? I also don't have a 'Show All Files' on my Solution Explorer like it used to in 2003, any ideas?
Mar 07, 2006 07:27 PM|ScottGu|LINK
It sounds like above you are using a VS 2005 Web Site Project -- which is different from the VS 2005 Web Application Project option that I described in that link above. If you want to migrate using the VS 2005 Web Application Project option, I'd recommend
following this link:
http://webproject.scottgu.com/CSharp/Migration/Migration.aspx This will allow you access to the field members, and allow you to change their access from protected to public.
If you use a web-site project, the .designer.cs file is generated for you automatically. In this case you'll want to add a property access to your code-behind file to expose controls (note: I'd recommend this pattern anyway since it is cleaner -- but with
the web application project type you can still get away with just marking the field public).
Hope this helps,