Deployment


Deployment is the most important factor to consider when choosing between the two control-authoring models.

The custom control model is designed for authoring redistributable components in the form of an assembly (compiled class library) that can be used by a number of applications. The assembly containing the controls can be used by a single application at a time when placed in the application's private bin directory, or it can be shared across multiple applications when placed into the global assembly cache , commonly referred to as the GAC . The assembly can be deployed and used in its compiled binary form without the associated source code.

The user control model is designed for single-application scenarios. As we described in Chapter 4, a user control is dynamically compiled at run time when a page that uses it is first requested . As a result, a user control must be deployed in source form, and the .ascx file (and its associated code-behind, if any exists) must be copied into every application that requires the user control. These requirements have the side effect of increasing maintenance costs because changes made to one copy must be manually replicated in all applications in which the user control is deployed. Note that this is a limitation of the current version; future versions of ASP.NET might enable you to statically compile declarative .ascx files into the equivalent of custom controls.



Developing Microsoft ASP. NET Server Controls and Components
Developing Microsoft ASP.NET Server Controls and Components (Pro-Developer)
ISBN: 0735615829
EAN: 2147483647
Year: 2005
Pages: 183

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net