On asp:radiobutton selection state changed (VB.net)
<%@ Page Language=VB Debug=true %>
<script runat=server>
Sub rgShipping_Clicked(Sender As Object, E As EventArgs)
If rdoUPS.Checked = True Then
Session("ShippingMethod") = "UPS"
ElseIf rdoUSPS.Checked = True Then
Session("ShippingMethod") = "USPS"
Else
Session("ShippingMethod") = "FedEx"
End If
lblShipSelected.Text = Session("ShippingMethod")
End Sub
</SCRIPT>
<HTML>
<HEAD>
<TITLE>Writing Code that Fires when Selection Changes</TITLE>
</HEAD>
<form runat="server">
<BR><BR>
<asp:Label
id="lblShipSelected"
runat="server"
/>
<BR>
Select Shipping Type:
<BR>
<asp:radiobutton
id="rdoUPS"
text="UPS"
autopostback="True"
oncheckedchanged="rgShipping_Clicked"
groupname="rgShipping"
runat="server"
/>
<BR>
<asp:radiobutton
id="rdoUSPS"
text="United States Postal Service"
autopostback="True"
oncheckedchanged="rgShipping_Clicked"
groupname="rgShipping"
runat="server"
/>
<BR>
<asp:radiobutton
id="rdoFedEx"
text="FedEx"
autopostback="True"
oncheckedchanged="rgShipping_Clicked"
groupname="rgShipping"
runat="server"
/>
<BR>
</form>
</BODY>
</HTML>
Related examples in the same category