UserControl as unit of reuse - problems

Discussion in 'ASP .Net' started by Oliver, Nov 16, 2003.

  1. Oliver

    Oliver Guest

    hi all -
    - I'm probably a) completely wrong b) the umpteenth person too
    mention it - but I'm struggling to identify how to best work with
    re-usable units of UI on an ASP page.

    the problem is really:
    1) UserControl - perfect *but* can't be re-used site wide - I *must*
    be wrong on this surely...

    2) Custom Control - perfect for some things - like sophisticated
    controls, but I don't want to use these for everything - I'd like my
    site(s) to be build almost entirely of re-usable components

    any hints appreciated
    Oliver
     
    Oliver, Nov 16, 2003
    #1
    1. Advertising

  2. Oliver,

    I think you've got it about right. You are wrong about user controls. They
    can be used site wide, but the key here is that they are application
    specific. If you site is broken up into multiple applications you'll want to
    use server controls instead. Yes, they are more complex, but you can use
    them anywhere. That's the trade off.

    Another option to create controls quickly is to use inheritance. For
    example, if you need a text box to do something special, create a class
    library, inherit the text box control already built into .Net and then
    modify it.

    Sincerely,

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:
    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzche


    "Oliver" <> wrote in message
    news:...
    > hi all -
    > - I'm probably a) completely wrong b) the umpteenth person too
    > mention it - but I'm struggling to identify how to best work with
    > re-usable units of UI on an ASP page.
    >
    > the problem is really:
    > 1) UserControl - perfect *but* can't be re-used site wide - I *must*
    > be wrong on this surely...
    >
    > 2) Custom Control - perfect for some things - like sophisticated
    > controls, but I don't want to use these for everything - I'd like my
    > site(s) to be build almost entirely of re-usable components
    >
    > any hints appreciated
    > Oliver
     
    S. Justin Gengo, Nov 16, 2003
    #2
    1. Advertising

  3. Oliver

    Jos Guest

    Oliver wrote:
    > hi all -
    > - I'm probably a) completely wrong b) the umpteenth person too
    > mention it - but I'm struggling to identify how to best work with
    > re-usable units of UI on an ASP page.
    >
    > the problem is really:
    > 1) UserControl - perfect *but* can't be re-used site wide - I *must*
    > be wrong on this surely...
    >
    > 2) Custom Control - perfect for some things - like sophisticated
    > controls, but I don't want to use these for everything - I'd like my
    > site(s) to be build almost entirely of re-usable components
    >
    > any hints appreciated
    > Oliver


    Other key differences are:
    - Custom Controls can raize their own events
    - Custom Controls can be added to the toolbox, both in VS.NET and
    Web Matrix.
    - The custom properties for Custom Controls can also be set from the
    Properties pane in these editors.
    For User Controls you'll have to hand-code these properties.

    --

    Jos
     
    Jos, Nov 16, 2003
    #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. tshad
    Replies:
    5
    Views:
    537
    Steve C. Orr [MVP, MCSD]
    May 17, 2005
  2. Hylander

    To reuse or not to reuse....

    Hylander, Feb 26, 2004, in forum: Java
    Replies:
    0
    Views:
    424
    Hylander
    Feb 26, 2004
  3. code reuse and design reuse

    , Feb 7, 2006, in forum: C Programming
    Replies:
    16
    Views:
    1,028
    Malcolm
    Feb 12, 2006
  4. jacob navia

    To reuse or not to reuse

    jacob navia, Nov 5, 2006, in forum: C Programming
    Replies:
    19
    Views:
    530
    Dave Thompson
    Dec 18, 2006
  5. VvanN
    Replies:
    5
    Views:
    490
    Phlip
    Apr 28, 2006
Loading...

Share This Page