Cannot Access Base Members when Inheriting WebControl

Discussion in 'ASP .Net' started by TJO, Mar 15, 2006.

  1. TJO

    TJO Guest

    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?
     
    TJO, Mar 15, 2006
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    >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?
    >
     
    Jose Rodriguez, Mar 15, 2006
    #2
    1. Advertising

  3. TJO

    TJO Guest

    Even thought the base class is a base webcontrol?
     
    TJO, Mar 16, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Harry F. Harrison
    Replies:
    0
    Views:
    2,901
    Harry F. Harrison
    Dec 18, 2003
  2. CoolPint
    Replies:
    8
    Views:
    1,000
    Jeff Schwab
    Dec 14, 2003
  3. flopbucket
    Replies:
    2
    Views:
    434
    Andrey Tarasevich
    Jun 23, 2006
  4. Replies:
    4
    Views:
    407
  5. Rudi van den Belt

    CodeAcces Security + Inheriting WebControl

    Rudi van den Belt, Oct 25, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    124
    Rudi van den Belt
    Oct 25, 2004
Loading...

Share This Page