|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
hides inherited member ApplicationInstanceCreate a web user control to use as a base class for other web user controls. Now, create a new web user control, change the class it inherits from to your base class and compile. (You must have a <% Register %> so it will see it) You will get TWO warnings per class like: Warning 4 'YourUserControl.ApplicationInstance' hides inherited member 'BaseUserControl.ApplicationInstance'. Use the new keyword if hiding was intended. c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\miniter\3f4ac539\1f8cc57b\App_Web_53s4mlbp.0.cs 29 Warning 3 'YourUserControl.Profile' hides inherited member 'BaseUserControl.Profile'. Use the new keyword if hiding was intended. c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\miniter\3f4ac539\1f8cc57b\App_Web_53s4mlbp.0.cs 23 Problem is the inherited member it is hiding was code generated by the base class, and the code generated for the inheriting class automatically by Visual Studio. This warning does not seem to cause any issues, but would like to get rid of it, because when I deploy I have to sift through them all. Any help, future fixes? Should I file as a bug? Hi Wayne,
Welcome to ASPNET newsgroup. Regarding on the warning problem you mentioned, I did notice it in some other scenario. Actually this is a expected behavior due to the new ASP.NET page/usercontrol's partial class model. All the codebehind defines a partial class so that the actual compiled class will contains other dynamic generated properties... Currently our suggestion will be move those common base page classes or usercontrol base classes into a single alone class file (e.g put in the App_Code dir ... ) rather than use existing page or usercontrol's codebehind(partial class....) Also, I think you can post this request through the MSDN feedback center: http://lab.msdn.microsoft.com/productfeedback/default.aspx but it may need sometime for the dev guys to reconsider it since that'll cause change to the underlying page structure and compilation model.... Thanks, Steven Cheng Microsoft Online Support Get Secure! www.microsoft.com/security (This posting is provided "AS IS", with no warranties, and confers no rights.) -------------------- | From: "Wayne Brantley" <WayneBrantley@noemail.nospam> microsoft.public.dotnet.framework.aspnet:365214| Subject: hides inherited member ApplicationInstance | Date: Thu, 15 Dec 2005 17:06:45 -0500 | Lines: 31 | X-Priority: 3 | X-MSMail-Priority: Normal | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670 | X-RFC2646: Format=Flowed; Original | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 | Message-ID: <OHvqZPcAGHA.***@TK2MSFTNGP12.phx.gbl> | Newsgroups: microsoft.public.dotnet.framework.aspnet | NNTP-Posting-Host: pcp01076601pcs.midval01.tn.comcast.net 68.59.220.208 | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl | Xref: TK2MSFTNGXA02.phx.gbl Show quoteHide quote | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet | | VS2005 RTM | | Create a web user control to use as a base class for other web user | controls. | Now, create a new web user control, change the class it inherits from to | your base class and compile. | (You must have a <% Register %> so it will see it) | | You will get TWO warnings per class like: | | Warning 4 'YourUserControl.ApplicationInstance' hides inherited member | 'BaseUserControl.ApplicationInstance'. Use the new keyword if hiding was | intended. c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET | Files\miniter\3f4ac539\1f8cc57b\App_Web_53s4mlbp.0.cs 29 | | Warning 3 'YourUserControl.Profile' hides inherited member | 'BaseUserControl.Profile'. Use the new keyword if hiding was intended. | c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET | Files\miniter\3f4ac539\1f8cc57b\App_Web_53s4mlbp.0.cs 23 | | | Problem is the inherited member it is hiding was code generated by the base | class, and the code generated for the inheriting class automatically by | Visual Studio. | | This warning does not seem to cause any issues, but would like to get rid of | it, because when I deploy I have to sift through them all. | | Any help, future fixes? Should I file as a bug? | | | Steven,
Partial class - yep, that is the exact problem. However, let me be clear on what you are saying. I have an .ascx file with NOTHING in it but the control tag. <%@ Control Language="C#" AutoEventWireup="true" CodeFile="BaseEdit.ascx.cs" Inherits="Common_BaseEdit" %> I then have code behind that inherits from System.Web.UI.UserControl That causes some code behind to be generated. You are saying, I can just throw away the .ascx file (which stops the code from being generated) and have the classes inherit from my base class anyway? If this is true, the generated code is USELESS, even though I have looked at it and it generates some constructors, calls to base class methods, etc. Further if that is true, then it would be a SIMPLE change for your dev guys, because if an ascx file is empty (only contains the control tag) NO code generation is necessary!!!!! - (the ascx file cannot contain any controls for base web user controls anyway, so that is always the case) If that is what you are saying, then I can certainly do that to stop these warning methods (or better yet, I will move that file to an existing supporting class project library). Show quoteHide quote "Steven Cheng[MSFT]" <stch***@online.microsoft.com> wrote in message news:4zESKAiAGHA.1236@TK2MSFTNGXA02.phx.gbl... > Hi Wayne, > > Welcome to ASPNET newsgroup. > Regarding on the warning problem you mentioned, I did notice it in some > other scenario. Actually this is a expected behavior due to the new > ASP.NET > page/usercontrol's partial class model. All the codebehind defines a > partial class so that the actual compiled class will contains other > dynamic > generated properties... > Currently our suggestion will be move those common base page classes or > usercontrol base classes into a single alone class file (e.g put in the > App_Code dir ... ) rather than use existing page or usercontrol's > codebehind(partial class....) > > Also, I think you can post this request through the MSDN feedback center: > > http://lab.msdn.microsoft.com/productfeedback/default.aspx > > but it may need sometime for the dev guys to reconsider it since that'll > cause change to the underlying page structure and compilation model.... > > Thanks, > > Steven Cheng > Microsoft Online Support > > Get Secure! www.microsoft.com/security > (This posting is provided "AS IS", with no warranties, and confers no > rights.) > > > > -------------------- > | From: "Wayne Brantley" <WayneBrantley@noemail.nospam> > | Subject: hides inherited member ApplicationInstance > | Date: Thu, 15 Dec 2005 17:06:45 -0500 > | Lines: 31 > | X-Priority: 3 > | X-MSMail-Priority: Normal > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670 > | X-RFC2646: Format=Flowed; Original > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 > | Message-ID: <OHvqZPcAGHA.***@TK2MSFTNGP12.phx.gbl> > | Newsgroups: microsoft.public.dotnet.framework.aspnet > | NNTP-Posting-Host: pcp01076601pcs.midval01.tn.comcast.net 68.59.220.208 > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl > | Xref: TK2MSFTNGXA02.phx.gbl > microsoft.public.dotnet.framework.aspnet:365214 > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet > | > | VS2005 RTM > | > | Create a web user control to use as a base class for other web user > | controls. > | Now, create a new web user control, change the class it inherits from to > | your base class and compile. > | (You must have a <% Register %> so it will see it) > | > | You will get TWO warnings per class like: > | > | Warning 4 'YourUserControl.ApplicationInstance' hides inherited member > | 'BaseUserControl.ApplicationInstance'. Use the new keyword if hiding was > | intended. c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary > ASP.NET > | Files\miniter\3f4ac539\1f8cc57b\App_Web_53s4mlbp.0.cs 29 > | > | Warning 3 'YourUserControl.Profile' hides inherited member > | 'BaseUserControl.Profile'. Use the new keyword if hiding was intended. > | c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET > | Files\miniter\3f4ac539\1f8cc57b\App_Web_53s4mlbp.0.cs 23 > | > | > | Problem is the inherited member it is hiding was code generated by the > base > | class, and the code generated for the inheriting class automatically by > | Visual Studio. > | > | This warning does not seem to cause any issues, but would like to get > rid > of > | it, because when I deploy I have to sift through them all. > | > | Any help, future fixes? Should I file as a bug? > | > | > | > Thanks for your response Wayne,
Sorry if I haven't made things clear, for the following: ===================================== You are saying, I can just throw away the .ascx file (which stops the code from being generated) and have the classes inherit from my base class anyway? If this is true, the generated code is USELESS, even though I have looked at it and it generates some constructors, calls to base class methods, etc ====================================== Actually, what I want to mean is defining a separate base UserControl class(derived from Usercontrol) and there is no ascx file associated with it, in other words, it is just as a normal component class in the App_Code folder.... Then, our other concrete ascx usercontrol's codebehind UserControl class will derive from that class..... So to avoid those warning(some autogenerated properteis being hidden), we have to avoid make our ascx usercontrol's codebehind class derived from another ascx usercontrol's codebehind class( being autocompiled through partial class....).... Thanks, Steven Cheng Microsoft Online Support Get Secure! www.microsoft.com/security (This posting is provided "AS IS", with no warranties, and confers no rights.) -------------------- | From: "Wayne Brantley" <WayneBrantley@noemail.nospam> <4zESKAiAGHA.1***@TK2MSFTNGXA02.phx.gbl>| References: <OHvqZPcAGHA.***@TK2MSFTNGP12.phx.gbl> | Subject: Re: hides inherited member ApplicationInstance microsoft.public.dotnet.framework.aspnet:365323| Date: Fri, 16 Dec 2005 10:03:23 -0500 | Lines: 120 | X-Priority: 3 | X-MSMail-Priority: Normal | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670 | X-RFC2646: Format=Flowed; Original | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 | Message-ID: <uvZPkHlAGHA.***@TK2MSFTNGP11.phx.gbl> | Newsgroups: microsoft.public.dotnet.framework.aspnet | NNTP-Posting-Host: pcp01076601pcs.midval01.tn.comcast.net 68.59.220.208 | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl | Xref: TK2MSFTNGXA02.phx.gbl | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet CodeFile="BaseEdit.ascx.cs" | | Steven, | Partial class - yep, that is the exact problem. However, let me be | clear on what you are saying. | | I have an .ascx file with NOTHING in it but the control tag. | <%@ Control Language="C#" AutoEventWireup="true" Show quoteHide quote | Inherits="Common_BaseEdit" %> 68.59.220.208| | I then have code behind that inherits from | System.Web.UI.UserControl | | That causes some code behind to be generated. | | You are saying, I can just throw away the .ascx file (which stops the code | from being generated) and have the classes inherit from my base class | anyway? If this is true, the generated code is USELESS, even though I have | looked at it and it generates some constructors, calls to base class | methods, etc. Further if that is true, then it would be a SIMPLE change | for your dev guys, because if an ascx file is empty (only contains the | control tag) NO code generation is necessary!!!!! - (the ascx file cannot | contain any controls for base web user controls anyway, so that is always | the case) | | If that is what you are saying, then I can certainly do that to stop these | warning methods (or better yet, I will move that file to an existing | supporting class project library). | | | "Steven Cheng[MSFT]" <stch***@online.microsoft.com> wrote in message | news:4zESKAiAGHA.1236@TK2MSFTNGXA02.phx.gbl... | > Hi Wayne, | > | > Welcome to ASPNET newsgroup. | > Regarding on the warning problem you mentioned, I did notice it in some | > other scenario. Actually this is a expected behavior due to the new | > ASP.NET | > page/usercontrol's partial class model. All the codebehind defines a | > partial class so that the actual compiled class will contains other | > dynamic | > generated properties... | > Currently our suggestion will be move those common base page classes or | > usercontrol base classes into a single alone class file (e.g put in the | > App_Code dir ... ) rather than use existing page or usercontrol's | > codebehind(partial class....) | > | > Also, I think you can post this request through the MSDN feedback center: | > | > http://lab.msdn.microsoft.com/productfeedback/default.aspx | > | > but it may need sometime for the dev guys to reconsider it since that'll | > cause change to the underlying page structure and compilation model.... | > | > Thanks, | > | > Steven Cheng | > Microsoft Online Support | > | > Get Secure! www.microsoft.com/security | > (This posting is provided "AS IS", with no warranties, and confers no | > rights.) | > | > | > | > -------------------- | > | From: "Wayne Brantley" <WayneBrantley@noemail.nospam> | > | Subject: hides inherited member ApplicationInstance | > | Date: Thu, 15 Dec 2005 17:06:45 -0500 | > | Lines: 31 | > | X-Priority: 3 | > | X-MSMail-Priority: Normal | > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670 | > | X-RFC2646: Format=Flowed; Original | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 | > | Message-ID: <OHvqZPcAGHA.***@TK2MSFTNGP12.phx.gbl> | > | Newsgroups: microsoft.public.dotnet.framework.aspnet | > | NNTP-Posting-Host: pcp01076601pcs.midval01.tn.comcast.net Show quoteHide quote | > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl | > | Xref: TK2MSFTNGXA02.phx.gbl | > microsoft.public.dotnet.framework.aspnet:365214 | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet | > | | > | VS2005 RTM | > | | > | Create a web user control to use as a base class for other web user | > | controls. | > | Now, create a new web user control, change the class it inherits from to | > | your base class and compile. | > | (You must have a <% Register %> so it will see it) | > | | > | You will get TWO warnings per class like: | > | | > | Warning 4 'YourUserControl.ApplicationInstance' hides inherited member | > | 'BaseUserControl.ApplicationInstance'. Use the new keyword if hiding was | > | intended. c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary | > ASP.NET | > | Files\miniter\3f4ac539\1f8cc57b\App_Web_53s4mlbp.0.cs 29 | > | | > | Warning 3 'YourUserControl.Profile' hides inherited member | > | 'BaseUserControl.Profile'. Use the new keyword if hiding was intended. | > | c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET | > | Files\miniter\3f4ac539\1f8cc57b\App_Web_53s4mlbp.0.cs 23 | > | | > | | > | Problem is the inherited member it is hiding was code generated by the | > base | > | class, and the code generated for the inheriting class automatically by | > | Visual Studio. | > | | > | This warning does not seem to cause any issues, but would like to get | > rid | > of | > | it, because when I deploy I have to sift through them all. | > | | > | Any help, future fixes? Should I file as a bug? | > | | > | | > | | > | | |
Other interesting topics
ObjectDataSource won't perform updates
Access to the path is denied - trying to write a file CheckBoxList problem. Want to add some javascript to each checkbox CSS Question Please help me with FxCOP 1.32 and ASP.NET 2.0 Property Feature For Comparing DateTime Error: Cannot use a leading .. to exit above the top directory. Can I have a global.asax just for an application? The type '_Default' conflicts with the imported type '_Default' 2005 Differences in a nutshell? |
|||||||||||||||||||||||