Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Building Controls (http://www.velocityreviews.com/forums/f59-asp-net-building-controls.html)
-   -   Why can't user controls be compiled into DLL and shared with other web applications (http://www.velocityreviews.com/forums/t758764-why-cant-user-controls-be-compiled-into-dll-and-shared-with-other-web-applications.html)

Matt Adamson 03-05-2007 02:10 PM

Why can't user controls be compiled into DLL and shared with other web applications
 
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



John Saunders 03-05-2007 06:35 PM

Re: Why can't user controls be compiled into DLL and shared with other web applications
 
"Matt Adamson" <Adamson_Matthew@hotmail.com> wrote in message
news:e59ZRAzXHHA.3256@TK2MSFTNGP04.phx.gbl...
> 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



Steve C. Orr [MCSD, MVP, CSM, ASP Insider] 03-09-2007 12:20 PM

Re: Why can't user controls be compiled into DLL and shared with other web applications
 
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" <Adamson_Matthew@hotmail.com> wrote in message
news:e59ZRAzXHHA.3256@TK2MSFTNGP04.phx.gbl...
> 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
>




All times are GMT. The time now is 09:25 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57