Creating a Composite Control in Asp .Net

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

Close    To Top
  • Prev Article-Programming:
  • Next Article-Programming:
  • Now: Tutorial for Web and Software Design > Programming > dotnet > Programming Content
    Photoshop Tutorial
     

    Special Effect

      3D Effect
      Photoshop Articles
    Programming Tutorial
     

    C/C++ Tutorial

      Visual Basic
      C# Tutorial
    Database Tutorial
     

    MySQL Tutorial

      MS SQL Tutorial
      Oracle Tutorial
    Geek Tutorial
     

    Blogging Tutorial

      RSS Tutorial
      Podcasting Tutorial
    Graphic Design Tutorial
      Coreldraw Tutorial
      Illustrator Tutorial
      3D Tutorials
    Webmaster Articles
     

    Domain Service

      Web Hosting
      Site Promotion
    Java Tutorial/ Articles
     

    Java Servlets

      JavaEE Tutorial
     

    JavaBeans Tutorial

    XML Tutorial/ Articles
     

    XML Style

      AJAX Tutorial
      XML Mobile
    Flash Tutorial/ Articles
     

    Flash Video

      Action Script
      Flash Articles
    OS Tutorial/ Articles
      Linux Tutorial
      Symbian Tutorial
      MacOS Tutorial
    Personal Tech
      Hardware Tutorial
      Software Tutorial
      Online Auction