Click here to Skip to main content
15,896,154 members
Articles / Web Development / HTML

Introduction to Developing a Custom Web Control.

Rate me:
Please Sign up or sign in to vote.
3.90/5 (7 votes)
14 Feb 2005CPOL2 min read 54.1K   862   29  
This article explains the development of a custom web control using C#.
<%@ Register TagPrefix="cc1" Namespace="Genesys" Assembly="InformationLine" %>
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="WebApplication1.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>WebForm1</title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="C#" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<style>.infoheader {
	FONT-WEIGHT: bold; FONT-SIZE: 18pt; COLOR: indigo
}
.infobreif {
	FONT-WEIGHT: bold; FONT-SIZE: 14pt; COLOR: indigo
}
.infodetails {
	FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: indigo
}
.errorheader {
	FONT-WEIGHT: bold; FONT-SIZE: 18pt; COLOR: red
}
.errorbreif {
	FONT-WEIGHT: bold; FONT-SIZE: 14pt; COLOR: red
}
.errordetails {
	FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: red
}
.warningheader {
	FONT-WEIGHT: bold; FONT-SIZE: 18pt; COLOR: darkgreen
}
.warningbreif {
	FONT-WEIGHT: bold; FONT-SIZE: 14pt; COLOR: darkgreen
}
.warningdetails {
	FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: darkgreen
}
		</style>
	</HEAD>
	<body>
		<form id="Form1" method="post" runat="server">
			<cc1:informationline id="InformationLine2" runat="server" EnableViewState="False" Enabled="False" WarningHeaderTextCss="warningheader"
				ErrorHeaderTextCss="errorheader" ErrorDetailsTextCss="errordetails" ErrorBreifTextCss="errorbreif"
				WarningDetailsTextCss="warningdetails" WarningBreifTextCss="warningbreif" ErrorImage="images/icon_error.gif"
				WarningImage="images/icon_warn.gif" TdBackColor="Bisque" BorderWidth="1px" InfoDetailsTextCss="infodetails"
				InfoBreifTextCss="infobreif" InfoHeaderTextCss="infoheader" MsgType="ERROR" ErrorHeaderText="Error"
				InfoHeaderText="Information" WarningHeaderText="Warning" InfoImage="images/icon_info.gif" Width="100%"
				BackColor="Black" ToolTip="Information Line"></cc1:informationline><br>
			<FIELDSET style="WIDTH: 372px; HEIGHT: 173px"><legend>Customised Information , Errors 
					&amp; Warning</legend><br>
				<P><asp:label id="Label1" runat="server" Width="75px">Breif</asp:label><asp:textbox id="TextBox1" runat="server"></asp:textbox><br>
					<asp:label id="Label2" runat="server" Width="75px">Details</asp:label><asp:textbox id="TextBox2" runat="server"></asp:textbox><br>
					<asp:label id="Label3" runat="server" Width="75px">Debug</asp:label><asp:radiobutton id="RadioButton1" runat="server" GroupName="debug" Text="True"></asp:radiobutton><asp:radiobutton id="RadioButton2" runat="server" GroupName="debug" Text="False" Checked="True"></asp:radiobutton><BR>
					<asp:dropdownlist id=DropDownList1 runat="server" DataSource="<%# msgtype%>">
					</asp:dropdownlist><br>
					<asp:button id="Button1" Text="Show Information" Runat="server"></asp:button></P>
			</FIELDSET>
			<P></P>
			<FIELDSET style="WIDTH: 372px; HEIGHT: 85px"><legend>Errors &amp; Exception</legend><br>
				<P><asp:label id="Label4" runat="server" Width="75px">Debug</asp:label><asp:radiobutton id="Radiobutton4" runat="server" GroupName="error" Text="True"></asp:radiobutton><asp:radiobutton id="Radiobutton3" runat="server" GroupName="error" Text="False" Checked="True"></asp:radiobutton><BR>
					<asp:button id="Button2" runat="server" Text="Throw Division by Zero Exception"></asp:button></P>
			</FIELDSET>
			<font></font>
			<P>&nbsp;
				<asp:button id="Button3" runat="server" Text="Reset"></asp:button></P>
		</form>
	</body>
</HTML>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Program Manager Capgemini
United States United States
I have been working in software industry for the past 11 years, though i am trained to be a pharmacist. Enjoy working on complex and new technologies. Also cleared my SCJP and MCP certification examinations.

Comments and Discussions