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" <Wa***********@ noemail.nospam>
| References: <OH************ *@TK2MSFTNGP12. phx.gbl>
<4z************ **@TK2MSFTNGXA0 2.phx.gbl>
| Subject: Re: hides inherited member ApplicationInst ance
| 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: <uv************ *@TK2MSFTNGP11. phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: pcp01076601pcs. midval01.tn.com cast.net 68.59.220.208
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP11.phx. gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3653 23
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| 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="BaseE dit.ascx.cs"
| Inherits="Commo n_BaseEdit" %>
|
| I then have code behind that inherits from
| System.Web.UI.U serControl
|
| 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]" <st*****@online .microsoft.com> wrote in message
| news:4z******** ******@TK2MSFTN GXA02.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(part ial class....)
| >
| > Also, I think you can post this request through the MSDN feedback
center:
| >
| >
http://lab.msdn.microsoft.com/produc...k/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" <Wa***********@ noemail.nospam>
| > | Subject: hides inherited member ApplicationInst ance
| > | 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: <OH************ *@TK2MSFTNGP12. phx.gbl>
| > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | NNTP-Posting-Host: pcp01076601pcs. midval01.tn.com cast.net
68.59.220.208
| > | Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP12.phx. gbl
| > | Xref: TK2MSFTNGXA02.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:3652 14
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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 'YourUserContro l.ApplicationIn stance' hides inherited member
| > | 'BaseUserContro l.ApplicationIn stance'. Use the new keyword if hiding
was
| > | intended. c:\WINDOWS\Micr osoft.NET\Frame work\v2.0.50727 \Temporary
| > ASP.NET
| > | Files\miniter\3 f4ac539\1f8cc57 b\App_Web_53s4m lbp.0.cs 29
| > |
| > | Warning 3 'YourUserContro l.Profile' hides inherited member
| > | 'BaseUserContro l.Profile'. Use the new keyword if hiding was intended.
| > | c:\WINDOWS\Micr osoft.NET\Frame work\v2.0.50727 \Temporary ASP.NET
| > | Files\miniter\3 f4ac539\1f8cc57 b\App_Web_53s4m lbp.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?
| > |
| > |
| > |
| >
|
|
|