When to Use Each Type of Control


When to Use Each Type of Control

With composite controls and User control having so many similarities, there seems to be some redundancy in the framework. Since User controls have such an affinity with the designer, perhaps it seems you don't need custom composite controls at all. However, each style of composite controls has distinct advantages and disadvantages.

The biggest advantage of custom composite controls is that they are deployed as individual assemblies. Because custom composite controls are packaged in distinct assemblies, you may sign them and deploy them across the enterprise. You also may install them in the Global Assembly Cache. The primary downside to using custom composite controls is that they require more attention to detail in the coding process (there's no designer support).

The primary advantage to User controls is that they do include designer support. That makes them very easy to design visually. However, User controls have a downside in their deployment—they go with the project in which they were created, and they are deployed that way. You can include them as part of other projects, but that requires copying the ASCX and the CS files to the new project. They are not deployed as signed, secure assemblies.




Microsoft ASP. NET 2.0 Programming Step by Step
Microsoft ASP.NET 2.0 Step By Step (Step By Step (Microsoft))
ISBN: B002KE5VYO
EAN: N/A
Year: 2005
Pages: 177

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