How can we create custom controls in ASP.NET?Custom controls are user defined controls. They can be created by grouping existing controls, by deriving the control from System.Web.UI.WebControls.WebControl or by enhancing the functionality of any other custom control. Custom controls are compiled into DLL’s and thus can be referenced by as any other web server control.
Basic steps to create a Custom control:
1. Create Control Library 2. Write the appropriate code 3. Compile the control library 4. Copy to the DLL of the control library to the project where this control needs to be used 5. The custom control can then be registered on the webpage as any user control through the @Register tag.
|