ViewState property can not be accessed in derived class ???
Tech-Archive recommends: Fix windows errors by optimizing your registry
Hi,
Using inheritance, doesn't 'protected' mean that derived classes can
access that data if specified as protected in the base class ?
Aparently not: ViewState property is declared as protected in the
Control class. ListBox inherits (indirectly) from Control but the
ViewState property can not be accessed ???
It generates following compiler error :
"Cannot access protected member
'System.Web.UI.Control.ViewState' via a qualifier of type
'System.Web.UI.WebControls.ListBox'; the qualifier must be of
type 'PageCounter' (or derived from it)"
How come ?
Thank you
Chris
*** Sent via Developersdex
http://www.developersdex.com ***
.
Relevant Pages
- Re: Not pure virtual functions and mixing virtual and non virtual methods
... Should I call base class implementation or not? ... But doing the above assumes that one answer is good for all, that all derived classes will want the base class method called in the same way. ... More generally, the way I see it, if you combine invariant implementation with variant parts, you have no elegant way to change the variant part. ... Following them will remove all inheritance relationships. ... (comp.object) - Re: How can access varible from different class/
... I believe the problem here is about inheritance. ... Both derived classes were inheriting form the base class ... If I have textBoxe1 in 2 derived classes of the same project, how can I differentiate between them? ... System.Windows.Forms.Form does not contain a textBox1, so I don't see where the problem with inheritance is coming into play. ... (microsoft.public.dotnet.framework.windowsforms) - Re: How can access varible from different class/
... I believe the problem here is about inheritance. ... Both derived classes were inheriting form the base class ... I have textBoxe1 in 2 derived classes of the same project, how can I differentiate between them? ... Each of your forms are objects that were instantiated at some point, which means that both forms have properties and methods which derive from the System base form. ... (microsoft.public.dotnet.framework.windowsforms) - Re: Did I write a good (efficient) program?
... The priniples of object-oriented design do not include ... the use of inheritance to overcome inadequate or faulty ... modifying a base class may be ... principles to those of the paradigm. ... (comp.lang.cobol) - Re: Forms inheritance and templates
... inheritance correctly and avoiding having the delete controls. ... base form with a TabControl that has one tab that is common to all derived ... I suspect this is because the base class controls are created ... (microsoft.public.dotnet.framework.windowsforms) |
|