We can create the following types of custom controls in Visual Studio.NET:
• User control: A Web Forms page that can be used as a control on other Web Forms pages. Thus, if we already have a Web Forms page and we need to construct a similar one, we can use the existing page as a user control.
• Composite control: A combination of existing controls that is used as a single control. We can create a composite control in any .NET programming language and use it on an ASP.NET page. For example, we can create a composite control comprising a button and a text box in C# and use it on an ASP.NET page.
In addition to the custom controls discussed, we can perform the following action with controls:
• Extend the functionality of the existing Web Form controls to meet our requirements. For example, consider a situation in which an existing Web Forms control meets almost all of our requirements, but we need some additional features in the control. In such a situation, we can add more features to our Web Form and customize the control. This can be done by inheriting from the control and overriding its properties, methods, or events.
• Develop a custom control by inheriting directly from one of the Control base classes. We’ll need to do this when none of the existing Web Forms controls meets any of our requirements. The benefit of using the existing classes to create custom controls is that they provide the basic framework needed by a Web Forms control. This way, we can concentrate more on programming the features that we want to incorporate
Friday, March 5, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment