Page Templates
page 6 of 7
by . .
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 31142/ 53

A bit more... (cont.)
A bit more (cont.)

That code included a base template, a code-behind file and a user control's code-behind file.

The basic template creates the HTML tags and then the code-behind populates them. The code-behind also calls LoadControl which then loads the user control to the page. The UserCodeBehind class then takes care of the user control and the event that happens inside it.

User control code -

<%@ Control Inherits="TemplatedDesign.UserCodeBehind" Src="full1.vb" %>
<form runat="server">
<P>
<asp:Label id="SelThing" runat="server"></asp:Label></P>
<P>
<asp:RadioButtonList AutoPostBack="True" OnSelectedIndexChanged="EventHappen" id="Things" runat="server">
<asp:ListItem Value="Apples">Apples</asp:ListItem>
<asp:ListItem Value="Pears">Pears</asp:ListItem>
<asp:ListItem Value="Mangos">Mangos</asp:ListItem>
<asp:ListItem Value="Spikey Fruit">Spikey Fruit</asp:ListItem>
</asp:RadioButtonList></P>
</form>

See the demo here.


View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-20 4:25:07 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search