Newbee question on inheriting an user control?

Discussion in 'ASP .Net' started by Danny Ni, Jan 16, 2005.

  1. Danny Ni

    Danny Ni Guest

    Hi,

    I have one user control named Schedule.ascx, I want to create another
    control which is quite similar to schedule.ascx but differs in some methods
    and some UI elements, the way I am doing it right now, I save schedule.ascx
    as another name, say schedule2.ascx then I go to code behind and chane the
    class name and the methods I like to change. Also modify the UI on ascx
    file.

    This is working. But there is a problem, evertime I change Scedule.ascx ,
    either method and UI , I have to copy it to schedule2.ascx. Is there a
    better way to do this? I imagine inheritance could help, just don't know
    how to apply to this case.

    TIA
     
    Danny Ni, Jan 16, 2005
    #1
    1. Advertising

  2. Danny Ni

    David Jessee Guest

    You're saying you have to copy it to Schedule2.ascx. But you did'nt mention
    Why. Are you recieving an error?



    "Danny Ni" <> wrote in message
    news:uvFbZU5%...
    > Hi,
    >
    > I have one user control named Schedule.ascx, I want to create another
    > control which is quite similar to schedule.ascx but differs in some

    methods
    > and some UI elements, the way I am doing it right now, I save

    schedule.ascx
    > as another name, say schedule2.ascx then I go to code behind and chane the
    > class name and the methods I like to change. Also modify the UI on ascx
    > file.
    >
    > This is working. But there is a problem, evertime I change Scedule.ascx ,
    > either method and UI , I have to copy it to schedule2.ascx. Is there a
    > better way to do this? I imagine inheritance could help, just don't know
    > how to apply to this case.
    >
    > TIA
    >
    >
    >
     
    David Jessee, Jan 16, 2005
    #2
    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. Grober
    Replies:
    3
    Views:
    664
    Grober
    Dec 6, 2003
  2. DotNet
    Replies:
    5
    Views:
    407
    Kevin Spencer
    Jan 27, 2004
  3. Mick
    Replies:
    1
    Views:
    725
    =?Utf-8?B?VGFtcGEgLk5FVCBLb2Rlcg==?=
    Nov 29, 2004
  4. Arvind
    Replies:
    3
    Views:
    6,859
  5. Vikas Manghani

    Inheriting from User Control

    Vikas Manghani, Oct 14, 2007, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    800
    Nathan Sokalski
    Jan 8, 2008
Loading...

Share This Page