|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Odd behavior in 2005 with base page classeshad some odd results, most of which I've been able to address. I'm looking for some confirmation/advice. Both applications use a base page class inherited from System.Web.UI.Page. In both cases my base page class is in a separate folder of the web application (e.g. c:\mywebapp\baseclass). When I converted the second application, the wizard was insistent on creating an abstract stub for my base class, which messed everything up royally (circular reference errors). I unwound that. The wizard seems a little indiscrimanent about applying that particular coding pattern to my applications, btw. Anyway, upon first trying to compile my app I got errors that it couldn't find my base page class. I resolved that by adding the following to each page that complained about not finding the base class. <%@ Reference Page="~/BaseClasses/basepage.aspx" %> Everything is now compiling without error, but I am getting a lot of warnings like the following. Warning 2 'Nwea.BlueWater.GenericError.Profile' hides inherited member 'Nwea.BlueWater.BaseClasses.BasePage.Profile'. Use the new keyword if hiding was intended. c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\bluewateradmin\4c8ac349\b294ab7\App_Web_rga8akwb.0.cs 45 Warning 3 'Nwea.BlueWater.GenericError.ApplicationInstance' hides inherited member 'Nwea.BlueWater.BaseClasses.BasePage.ApplicationInstance'. Use the new keyword if hiding was intended. c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\bluewateradmin\4c8ac349\b294ab7\App_Web_rga8akwb.0.cs 51 I only get these in one of my converted projects, not the other (and they both use a base page class). The problem is that the warning is showing up in files that are being generated for me. Any thoughts/suggestions/pointers? Hi Craig,
Ah yes, the pain of upgrading real world projects <g>... The issues you are encountering are due to the fact that ASP.NET changes the way page inheritance works in 2.0. Add to that the abstraction that the Conversion Wizard adds and you end up with some cases where you get errors like you're experiencing. Now in your case the properties happen to be ASP.NET internal properties. Do you really have these properties implemented somewhere in your page hierarchy? Profile is a new ASP.NET property on the page class so if you had an existing Profile property there will be a conflict. This may not be a problem and you can simply add the New keyword as described. But if you do have a conflict then your only choice will be to rename... +++ Rick -- -- Show quoteHide quoteRick Strahl West Wind Technologies www.west-wind.com www.west-wind.com/weblog <craig.wag***@gmail.com> wrote in message news:1132944934.830694.122370@f14g2000cwb.googlegroups.com... >I have converted two ASP.NET 1.1 applications to ASP.NET 2.0. Each one > had some odd results, most of which I've been able to address. I'm > looking for some confirmation/advice. > > Both applications use a base page class inherited from > System.Web.UI.Page. In both cases my base page class is in a separate > folder of the web application (e.g. c:\mywebapp\baseclass). > > When I converted the second application, the wizard was insistent on > creating an abstract stub for my base class, which messed everything up > royally (circular reference errors). I unwound that. The wizard seems a > little indiscrimanent about applying that particular coding pattern to > my applications, btw. > > Anyway, upon first trying to compile my app I got errors that it > couldn't find my base page class. I resolved that by adding the > following to each page that complained about not finding the base > class. > > <%@ Reference Page="~/BaseClasses/basepage.aspx" %> > > Everything is now compiling without error, but I am getting a lot of > warnings like the following. > > Warning 2 'Nwea.BlueWater.GenericError.Profile' hides inherited > member 'Nwea.BlueWater.BaseClasses.BasePage.Profile'. Use the new > keyword if hiding was intended. > c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET > Files\bluewateradmin\4c8ac349\b294ab7\App_Web_rga8akwb.0.cs 45 > Warning 3 'Nwea.BlueWater.GenericError.ApplicationInstance' hides > inherited member > 'Nwea.BlueWater.BaseClasses.BasePage.ApplicationInstance'. Use the new > keyword if hiding was intended. > c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET > Files\bluewateradmin\4c8ac349\b294ab7\App_Web_rga8akwb.0.cs 51 > > I only get these in one of my converted projects, not the other (and > they both use a base page class). The problem is that the warning is > showing up in files that are being generated for me. > > Any thoughts/suggestions/pointers? >
Other interesting topics
ASP.NET 2.0 Frustration - MS Please Help
ASP.NET does not honor Title nor Javscript options Web.Config file seems to be ignored Wizard Control How to receive keyboard input? DataGrid Nightmare About KB Article 831150 Bind DropDownList to XmlDataSource http 1.1/ 403 access forbidden after framework 2.0 installed Q: moving project folder |
|||||||||||||||||||||||