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

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">
<asp:Label id="SelThing" runat="server"></asp:Label></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>

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  |  Page Processed at 2024-04-15 7:00:11 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search