Passing Variables from User Controls to ASP.NET pagesserver-side includes to maintain
a consistent look across a website is a common way I've found to be
useful. ASP has introduced pagelets, these pages are separate files
or webpages that contain certain information you want displayed across
several webpages. The nice thing about pagelet is they are very similar
to server-side include files.Both file
types allow to have the code in one file and using "DIRECTIVES" to call
that page across several files. I've used server-side include files to
maintain a similar look and feel for many of my webpages on
ASPFree.com. I used this method to dynamically pass a TitleBarDemo
variable that gets set on every page. Pagelets can also contain logic
code that can greatly increase the power of what they perform.
Pagelet(User Control) Code<script language="VB" runat=server>
'Declare a public variable that can be set
Public TitleOfDemo as String
</script>
<HTML>
<head>
<title><% =TitleOfDemo %></title>
</head>
<body>
</body>
</html> [/color][/size]
[/size] ASP page code'Registering the a pagelet (user control) file
'This gets listed at the top of the .aspx page[/size][/b]
<%@ Register TagPrefix="ListFirst" TagName="ListSecond" Src="pagelet.aspc" %>'Method of having the pagelet file executed
'Setting the TitleOfDemo variable to a value.
TitleOfDemo="ASPFree, this would show in the title bar!" runat="server"/>
ليتك تحلو والحياة مريره وليتك ترضى والانام غضاب
وليت الذى بينى وبينك عامر وبينى وبين العالمين خراب
إذا صحّ منك الود فالكل هيّن وكل الذى فوق التراب تراب
اللهم ارحم موتانا وموتى جميع المسلمين
اللهم أنزل على قبورهم الضياء والنور والفسحة والسرور وجازهم بالاحسان إحسان وبالسيئات عفوا وغفرانا