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. Advertisements

  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. Advertisements

  3. TJO

    TJO Guest

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

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:
    3,104
    Harry F. Harrison
    Dec 18, 2003
  2. CoolPint
    Replies:
    8
    Views:
    1,266
    Jeff Schwab
    Dec 14, 2003
  3. Dave
    Replies:
    1
    Views:
    533
    Alf P. Steinbach
    Jul 22, 2005
  4. Replies:
    2
    Views:
    1,080
    Noah Roberts
    Jun 9, 2006
  5. flopbucket
    Replies:
    2
    Views:
    534
    Andrey Tarasevich
    Jun 23, 2006
  6. John Femiani
    Replies:
    1
    Views:
    538
    Victor Bazarov
    Nov 6, 2007
  7. Replies:
    4
    Views:
    546
  8. Subra
    Replies:
    4
    Views:
    619
    fenghuang
    Nov 30, 2010
Loading...