Tutorials
Resources
Forum
Reviews
Communities
Interview
Jobs
Projects
Training
Your
Ad
Here
Silverlight Games
|
Mentor
|
Code Converter
|
Articles
|
Code Factory
|
Computer Jokes
|
Members
|
Peer Appraisal
|
IT Companies
|
Bookmarks
|
Polls
|
Revenue Sharing
|
Lobby
|
Gift Shop
|
Prizes & Awards
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
Alwyn
(42)
Abhisek Panda
(40)
Nadheera V
(40)
Last 7 Days
Alwyn
(706)
nishithraj
(512)
Gaurav Arora
(504)
more...
Resources
»
Articles
»
ASP.NET/Web Applications
»
Adding common functionality with user controls
Posted Date: 13 Mar 2004
Resource Type:
Articles
Category:
ASP.NET/Web Applications
Author:
Siva
Member Level:
Gold
Rating:
Points
: 5
User controls allow you to build your own custom controls from any other control. You can apply this to every page in your application rapidly by packaging common functionality into a reusable package. A great example of this is a menu that will be rendered on a high percentage of your Web pages. By encapsulating this functionality into a user control, you can drag and drop the control onto a Web page and move on.
Because the user control contains all the presentation and code, maintenance is reduced -- when you update the user control, all your pages will be ready to go.
For instance, the following user control adjusts the hyperlink based on the value set on the control's SourceURL property. You could position this user control on every page to provide consistent navigation to resources such as help files:
<%@ Control Language="vb" AutoEventWireup="false"
Codebehind="UserControlDemo.ascx.vb"
Inherits="UserControlDemo.UserControlDemo"
%>
<LINK href="Styles.css" type="text/css" rel="stylesheet">
&tl;TABLE id="Table1" cellSpacing="0" cellPadding="0"
border="0">
<TR>
<TD align="right">
<IMG src="Images/HelpIcon.gif"></TD>
<TD>
<asp:HyperLink id="HelpHyperlink" runat="server">
User Control Demo
</asp:HyperLink>
</TD>
</TR>
</TABLE>
Siva
Responses
No responses found. Be the first to respond and make money from
revenue sharing program
.
Feedbacks
Popular Tags
What are tags ?
Search Tags
Sign In
to add tags.
(No tags found.)
Post Feedback
This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must
Sign In
to post a response.
Next Resource:
Path Mapping in Asp.Net
Previous Resource:
Cause button click on Enter
Return to Discussion Resource Index
Post New Resource
Category:
ASP.NET/Web Applications
Post resources and
earn money
!
More Resources
Finding -From what page was the message posted to the log?
JavaScript setting values
Using JavaScript to save roundtrips
Automatic transaction using ASP.NET
Setting permissions to write to event log
About State in Asp.Net
dotNet Slackers
About Us
Contact Us
Privacy Policy
Terms Of Use