Creating a Composite Control in Asp .Net
CoderSource.net
Creating a Composite Control in Asp .Net
Level: MediumType: Article
Rating: Page: 1 of 3

Date: 7/13/2005 12:00:00 AM

Environment: IIS, ASP .Net, Visual Studio .Net, Windows

Creating a Composite Control in Asp .Net 

   A choice towards a composite control is made when there is a need for a group of controls to perform a particular action in sync.

Also it is going to be used in many projects. For example if we want a calculator UI to be made, then it needs a text box, a number of button controls to be grouped together along with the functional code. If this calculator UI and functionality are going to be reused in many projects, then it is wiser to create it as a re-usable control, instead of copy/pasting the code every time. This way, when different web controls are put together as a single control, it makes a composite control.

Adding the Composite Control to the Visual Studio .Net:

   A composite control is a Group of some UI of existing controls along with the functional code compiled into a web control library dll . These composite controls need to be used by adding them to the Tool box of Visual Studio .Net. They can be added to the Visual Studio .Net tool box as follows. 

  1. Expand the components group and Right click on the toolbox.
  2. Click the Add/Remove items.
  3. Browse to the dll path and ensure that it is checked from the list. It is checked by default when we choose the dll.
  4. Click Ok.

  This will add the composite control to the toolbox. After this, the control can be used normally like any other controls like TextBox, Button etc., Just a drag and drop will do the required actions. When we add this control, VS .Net will add the reference to dll in the background automatically, add the custom server control to the page, add a variable to the code behind file etc.,

   Read the next page on Creating the Composite Control using VS .Net.


Attachments

Project Files Composite Controls Sample

1 2 3

You Can Rate this Article, if you are Logged In      
 

More Links from CoderSource.net:

 
Refer to a Friend:

Your Details:

Name:     e-mail:

Friend Details:

Name:    e-mail:    


MENU
Home
MFC 
C++
.Net
WIN32
Programming
Forum
My Articles
Add to Google
Add to My Yahoo!
Welcome to Codersource.Net Login | Register | Faq  

SEARCH
Google
 

NOTES:


Thanks for visiting our CoderSource.net. This site will be improved with more articles. Interested visitors can also submit their articles through the Submit Article link.Your article will also be published after due consideration by the editor. 

© Copyright 2003. All rights on content reserved by CoderSource.net. Contact    About Us