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.