Creating Custom Controls in Asp .Net
CoderSource.net
Creating Custom Controls in Asp .Net
Level: MediumType: Article
Rating: Page: 1 of 1

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

Environment: Asp .Net, IIS, Visual Studio .Net

  Creating controls in ASP .Net Controls are a useful way of distributing a custom, repeatable functionality with or without UI and typically used within and across an organization.

Previous COM and ActiveX era had serious limitations on this front as they required permissions for each control to be accepted inside the organizations. ASP .Net has replaced this with a nice model which do not require local permissions any more. The newer framework are not permitted with any access to the local disk, which in turn makes them loadable without any permissions.

This section does not try to address the ASP .Net User Controls. If you want to get some basics on User controls, u can read the following articles.

  1. http://www.codersource.net/asp_net_user_controls_azam.aspx
  2. http://www.codersource.net/asp_net_web_user_controls.html
These custom controls can be created in either of the following 3 methods.
  1. Creating as a composite control : This method uses and combines the existing controls to give a custom functionality which can be used across different projects by adding to the control library. This can provide for event bubbling from child controls to the Parent container, custom event handling and properties. The CreateChildControls function of the Control class should be overridden for creating this custom control. This can also support design time rendering of the control.
  2. Deriving from an existing control : This method of creating a custom control derives from an existing ASP .Net control and customizing the properties that we need. This also can support custom event handling, properties etc.,
  3. Creating a control from Scratch : This method is the one which needs maximum programming. This method needs even the HTML code for the custom controls to be written by the programmer. This may also need one to implement the IPostBackDataHandler and IPostBackEventHandler interfaces. A detailed explanation with example for this is available at Rendering Custom Controls Sample in MSDN.

1

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