Click here to Skip to main content
15,896,063 members
Articles / Web Development / ASP.NET

Programatically include an ASP.NET UserControl in a Web Page

Rate me:
Please Sign up or sign in to vote.
4.71/5 (14 votes)
9 Mar 20024 min read 277.4K   2.1K   65  
A tutorial on how to programatically include an ASP.NET UserControl in a web page.
<%@ Page language="c#" Codebehind="BrowserChk.aspx.cs" AutoEventWireup="false" Inherits="ASPNet_App.BrowserChk" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>BrowserChk</title>
		<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
		<meta name="CODE_LANGUAGE" Content="C#">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		<link rel="stylesheet" type="text/css" href="SoftomatixStyles.css">
	</HEAD>
	<body MS_POSITIONING="GridLayout">
		<div style="WIDTH:800px">
			<div class="pageTitle" align="center">Softomatix ASP.Net Collections</div>
			<div class="leftPane" style="Z-INDEX: 100">
				<div class="leftPaneSectionTitle">
					Utilities
				</div>
				<br>
				<div class="leftPaneSectionList">
					<ul>
						<li>
							<a href="BrowserChk.aspx">Client Browser</a>
						</li>
					</ul>
				</div>
			</div>
			<div class="rightPane" style="Z-INDEX: 101">
				<form id="BrowserChk" method="post" runat="server">
					<div align="left">
						User Agent:
						<asp:Label id="wndUserAgent" style="Z-INDEX: 102;" runat="server">Label</asp:Label>
					</div>
					<div class="infoTable" align=center style="width:100%;">
					<asp:Table Runat=server CellPadding=1 CellSpacing=0 ID="wndInfoTable" HorizontalAlign=Left CssClass=infoTable>
					</asp:Table>
					</div>
				</form>
			</div>
		</div>
		
	</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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
To learn more about us, Please visit us at http://www.netomatix.com

Comments and Discussions