Why can't user controls be compiled into DLL and shared with other web applications

Discussion in 'ASP .Net Building Controls' started by Matt Adamson, Mar 5, 2007.

  1. Matt Adamson

    Matt Adamson Guest

    Guys,

    Does anyone know the technical reason why user controls couldn't be compiled
    into an assembly and shared with other web applications.

    If the ASP.NET compiler can compile the user control pages at runtime into
    an assembly then why couldn't this be compiled and then shared with other
    web applications. Perhaps we could write a module on top of ASP.NET which
    could re use user controls in other web applications.

    Thought?

    Cheers

    Matt
    Matt Adamson, Mar 5, 2007
    #1
    1. Advertising

  2. "Matt Adamson" <> wrote in message
    news:...
    > Guys,
    >
    > Does anyone know the technical reason why user controls couldn't be
    > compiled into an assembly and shared with other web applications.
    >
    > If the ASP.NET compiler can compile the user control pages at runtime into
    > an assembly then why couldn't this be compiled and then shared with other
    > web applications. Perhaps we could write a module on top of ASP.NET which
    > could re use user controls in other web applications.


    I don't think it's a technical reason, just a design reason. That's not what
    user controls are for.

    User controls are meant to be a simple way to build a composite control
    without writing any code. They're not meant to be general purpose.

    Now, at some time in the future, Microsoft could introduce a visual
    composite control editor that might take the place of user controls for many
    purposes, but user controls are meant to be more of a replacement for
    server-side includes in ASP than they are meant to be real custom server
    controls.

    That said, it's not that difficult to write a composite control which is the
    equivalent of a given user control. It takes longer and requires more
    knowledge of controls, but it's not very difficult.

    John
    John Saunders, Mar 5, 2007
    #2
    1. Advertising

  3. That's what Custom controls are for. Custom controls have great
    reusability, but they're kinda hard to make.
    User controls are only reusable within a single project but they are easy to
    make.
    Pick your poison.

    Here's more info:
    http://SteveOrr.net/faq/UserCustom.aspx

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


    "Matt Adamson" <> wrote in message
    news:...
    > Guys,
    >
    > Does anyone know the technical reason why user controls couldn't be
    > compiled into an assembly and shared with other web applications.
    >
    > If the ASP.NET compiler can compile the user control pages at runtime into
    > an assembly then why couldn't this be compiled and then shared with other
    > web applications. Perhaps we could write a module on top of ASP.NET which
    > could re use user controls in other web applications.
    >
    > Thought?
    >
    > Cheers
    >
    > Matt
    >
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider], Mar 9, 2007
    #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. ben
    Replies:
    3
    Views:
    502
    Kevin Spencer
    Nov 15, 2004
  2. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,741
    Smokey Grindel
    Dec 2, 2006
  3. Guest
    Replies:
    0
    Views:
    420
    Guest
    Feb 21, 2007
  4. HelloLinux
    Replies:
    3
    Views:
    390
    HelloLinux
    Jun 26, 2008
  5. H. Simpson
    Replies:
    4
    Views:
    243
    H. Simpson
    Aug 3, 2004
Loading...

Share This Page