User Controls Versus DLLs

Discussion in 'ASP .Net Web Controls' started by Gopal Krish, Oct 5, 2004.

  1. Gopal Krish

    Gopal Krish Guest

    Wondering what's the pros and cons in creating reusable web controls
    using

    1. User Controls
    2. C# class that creates the controls programmatically

    Example,

    I want to develop a page menu (Reset, Back, Submit etc) that I can
    reuse in all my screens. Reset and Back are Hyperlinks and Submit is
    Link Button (which should fire a Click even when clicked).

    My question is..should I develop a reusable user control or should I
    write a C# /VB.NET class to create the controls programmatically?

    Thanks for any thoughts.

    -- Gopal
     
    Gopal Krish, Oct 5, 2004
    #1
    1. Advertising

  2. Gopal Krish

    Lucas Tam Guest

    (Gopal Krish) wrote in news:8b4092e6.0410041628.1add2854
    @posting.google.com:

    > 1. User Controls
    > 2. C# class that creates the controls programmatically
    >
    > Example,
    >
    > I want to develop a page menu (Reset, Back, Submit etc) that I can
    > reuse in all my screens. Reset and Back are Hyperlinks and Submit is
    > Link Button (which should fire a Click even when clicked).
    >
    > My question is..should I develop a reusable user control or should I
    > write a C# /VB.NET class to create the controls programmatically?


    You can design the interface graphically with user controls.

    With user controls, you can't instantiate them like a normal class, rather
    you need to use the LoadControl method. Besides this minor point, I would
    use User Controls for design intensive controls. Otherwise I would use a
    class.

    BTW, you can always mix and match the two... use a user control for the
    interface and a class for the logic.

    --
    Lucas Tam ()
    Please delete "REMOVE" from the e-mail address when replying.
    http://members.ebay.com/aboutme/coolspot18/
     
    Lucas Tam, Oct 5, 2004
    #2
    1. Advertising

  3. User controls are easy to create.

    Conversly, Custom controls are easier to use and to reuse.

    Here's more info:
    http://msdn.microsoft.com/library/d...n/html/vbconintroductiontowebusercontrols.asp
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vboriwebusercontrols.asp
    http://msdn.microsoft.com/library/d...l/vbconWebUserControlsVsCustomWebControls.asp

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://Steve.Orr.net



    "Gopal Krish" <> wrote in message
    news:...
    > Wondering what's the pros and cons in creating reusable web controls
    > using
    >
    > 1. User Controls
    > 2. C# class that creates the controls programmatically
    >
    > Example,
    >
    > I want to develop a page menu (Reset, Back, Submit etc) that I can
    > reuse in all my screens. Reset and Back are Hyperlinks and Submit is
    > Link Button (which should fire a Click even when clicked).
    >
    > My question is..should I develop a reusable user control or should I
    > write a C# /VB.NET class to create the controls programmatically?
    >
    > Thanks for any thoughts.
    >
    > -- Gopal
     
    Steve C. Orr [MVP, MCSD], Oct 5, 2004
    #3
  4. In your case it would be MUCH MUCH easier to write User Controls, while it's
    single application dependant and it's not as reusable as Web Custom Controls
    should be.

    I suggest you to use User Controls in this particular case.

    --
    RobertK
    { Clever? No just smart. }

    "Gopal Krish" <> wrote in message
    news:...
    > Wondering what's the pros and cons in creating reusable web controls
    > using
    >
    > 1. User Controls
    > 2. C# class that creates the controls programmatically
    >
    > Example,
    >
    > I want to develop a page menu (Reset, Back, Submit etc) that I can
    > reuse in all my screens. Reset and Back are Hyperlinks and Submit is
    > Link Button (which should fire a Click even when clicked).
    >
    > My question is..should I develop a reusable user control or should I
    > write a C# /VB.NET class to create the controls programmatically?
    >
    > Thanks for any thoughts.
    >
    > -- Gopal
     
    Robert Koritnik, Oct 5, 2004
    #4
  5. Gopal Krish

    Gopal Krish Guest

    Thanks much..

    "Robert Koritnik" <> wrote in message news:<>...
    > In your case it would be MUCH MUCH easier to write User Controls, while it's
    > single application dependant and it's not as reusable as Web Custom Controls
    > should be.
    >
    > I suggest you to use User Controls in this particular case.
    >
    > --
    > RobertK
    > { Clever? No just smart. }
    >
    > "Gopal Krish" <> wrote in message
    > news:...
    > > Wondering what's the pros and cons in creating reusable web controls
    > > using
    > >
    > > 1. User Controls
    > > 2. C# class that creates the controls programmatically
    > >
    > > Example,
    > >
    > > I want to develop a page menu (Reset, Back, Submit etc) that I can
    > > reuse in all my screens. Reset and Back are Hyperlinks and Submit is
    > > Link Button (which should fire a Click even when clicked).
    > >
    > > My question is..should I develop a reusable user control or should I
    > > write a C# /VB.NET class to create the controls programmatically?
    > >
    > > Thanks for any thoughts.
    > >
    > > -- Gopal
     
    Gopal Krish, Oct 5, 2004
    #5
    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. Matthew Louden
    Replies:
    1
    Views:
    7,114
    Scott M.
    Oct 11, 2003
  2. A.M
    Replies:
    3
    Views:
    296
    Steven Cheng[MSFT]
    Feb 18, 2004
  3. Gopal Krish

    User Controls Versus DLLs

    Gopal Krish, Oct 5, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    592
    Gopal Krish
    Oct 5, 2004
  4. A.M

    Separated DLLs for user controls

    A.M, Feb 17, 2004, in forum: ASP .Net Security
    Replies:
    3
    Views:
    106
    Steven Cheng[MSFT]
    Feb 18, 2004
  5. Paul Butcher
    Replies:
    12
    Views:
    786
    Gary Wright
    Nov 28, 2007
Loading...

Share This Page