473,738 Members | 8,397 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

hides inherited member ApplicationInst ance

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?
Dec 15 '05 #1
3 5475
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?
|
|
|

Dec 16 '05 #2
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?
|
|
|

Dec 16 '05 #3
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?
| > |
| > |
| > |
| >
|
|
|

Dec 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
7691
by: ashok | last post by:
I have a confusion. Do static member functions of base class get inherited to derived class? I searched for this answer but nowhere I get any referencec saying "derived class inherits static functions with other member functions of the base class". regds,
4
1867
by: Lionel B | last post by:
Greetings, The following code: <code> template<typename T> class A { protected:
1
4342
by: Dave | last post by:
Hello NG, Regarding access-declarations and member using-declarations as used to change the access level of an inherited base member... Two things need to be considered when determining an inherited base member's access level in the derived class: its access level in the base class and the type of inheritance (public, protected, or private). After this determination is made, the following possibilities exist for manually changing the...
8
3079
by: TS | last post by:
I am trying to get set a property of a control on the inherited class from base class. I imagine i have to use reflection, so could someone give me the code to do it? something like this? this.GetType().GetMember("panel1").SetValue(xx).Left = 44;
2
6089
by: Paul Tomlinson | last post by:
The keyword new is required on 'B.IsValid' because it hides inherited member 'A.IsValid' All I have a couple of classes which resemble (sort of!) this: public class A { public bool bIsValid = true; public bool IsValid {
2
2404
by: Mark Olbert | last post by:
I have a v1.1 webapp that works fine on two different servers (my development machine and a Verio-hosted site). However, it blows up on a MaximumASP-hosted site at a particular line: private void Page_Load(object sender, System.EventArgs e) { // snippet theGlobal = (Global) Context.ApplicationInstance; } I put a bunch of site-wide methods and properties in the Global.asax file and reference them through
4
1455
by: Sebastian Böck | last post by:
Hello all, i have a view defined as a simple select of a table. This table is inherited by a couple of others. All entries belong to the child-tables. I also have an unconditional update rule on the view. If i do an update to the view, the update is rewritten to update the father-table.
6
1770
by: Peter Oliphant | last post by:
I just discovered that the ImageList class can't be inherited. Why? What could go wrong? I can invision a case where someone would like to add, say, an ID field to an ImageList, possible so that the individual elements in an array of ImageList's could be identified by the ID, thereby allowing re-ordering the array without harm. A person could identify by index into the array, but that would not be preserved by re-ordering (and re-ordering...
14
2640
by: lovecreatesbea... | last post by:
Could you tell me how many class members the C++ language synthesizes for a class type? Which members in a class aren't derived from parent classes? I have read the book The C++ Programming Language, but there isn't a detail and complete description on all the class members, aren't they important to class composing? Could you explain the special class behavior in detail? Thank you very much.
0
8788
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9335
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9263
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8210
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6751
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6053
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4570
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2745
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.