Mega Code Archive

 
Categories / ASP.Net Tutorial / Custom Controls
 

Use custom control in Assembly

<%@ Page Language="VB" %> <%@ Register TagPrefix="rntsoftASP" Namespace="MyCustomControls" Assembly="CustomControls"%> <html><body>    <form runat=server>       The custom control produces the following output:           <rntsoftASP:CustomControl1 id="MyControl" runat=server/>    </form> </body></html> //////C# using System; using System.Web; using System.Web.UI;      namespace MyCustomControls {    public class CustomControl1 : Control {       protected override void Render(HtmlTextWriter Output) {          Output.Write("This is my custom control! ");       }    } } //////VB Imports System Imports System.Web Imports System.Web.UI Namespace MyCustomControls    Public Class CustomControl1 : Inherits Control       Protected Overrides Sub Render(Output as HtmlTextWriter)          Output.Write("This is my custom control! ")       End Sub    End Class End Namespace