Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Cannot Access Base Members when Inheriting WebControl

Reply
Thread Tools

Cannot Access Base Members when Inheriting WebControl

 
 
TJO
Guest
Posts: n/a
 
      03-15-2006
I am having difficulty understanding why I cannot access my base .ascx
class members from my inherited class.

I create a base .ascx control and add a method.

public partial class myWebControlBase : System.Web.UI.UserControl
{
public virtual void _foo(){
}
}
I then create another ascx control by extending the base class:

public partial class ResumeCapture_ResumeCaptureBase : myWebControlBase

{

}

the compiler is telling me _foo() does not exists when I access it from
the HTML portion of my control. Nor does itellisense show the method.


Is inheritance of webcontrols handled differently in 2.0 than 1.0 or
1.1?

 
Reply With Quote
 
 
 
 
Jose Rodriguez
Guest
Posts: n/a
 
      03-15-2006
Tj, my first thought is that your base class must reside in the App_Code sub
directory otherwise it won't be accessible...hth

Jose
"TJO" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
>I am having difficulty understanding why I cannot access my base .ascx
> class members from my inherited class.
>
> I create a base .ascx control and add a method.
>
> public partial class myWebControlBase : System.Web.UI.UserControl
> {
> public virtual void _foo(){
> }
> }
> I then create another ascx control by extending the base class:
>
> public partial class ResumeCapture_ResumeCaptureBase : myWebControlBase
>
> {
>
> }
>
> the compiler is telling me _foo() does not exists when I access it from
> the HTML portion of my control. Nor does itellisense show the method.
>
>
> Is inheritance of webcontrols handled differently in 2.0 than 1.0 or
> 1.1?
>



 
Reply With Quote
 
 
 
 
TJO
Guest
Posts: n/a
 
      03-16-2006
Even thought the base class is a base webcontrol?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inheritance: Can the base class access a function in the class whichis inheriting from it? ngoonee@gmail.com C++ 4 03-14-2008 08:00 AM
accessing base class members when base is template flopbucket C++ 2 06-23-2006 01:40 AM
CodeAcces Security + Inheriting WebControl Rudi van den Belt ASP .Net Web Controls 0 10-25-2004 11:31 AM
Inheriting System.UI.ControlCollection for a WebControl - FindControl doesn't work??? Harry F. Harrison ASP .Net 0 12-18-2003 06:28 PM
Can nested class members access private members of nesting class? CoolPint C++ 8 12-14-2003 02:30 PM



Advertisments