On asp:radiobutton selection state changed (VB.net) : RadioButton « Asp Control « ASP.Net






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

1.asp:radiobutton: group name (VB.net)
2.asp:radiobutton: text align (VB.net)
3.Set asp:radiobutton checked (VB.net)
4.Font-Size, Font-Bold, Font-Name for radio button (VB.net)
5.GroupName for asp:radiobutton (VB.net)
6.Check a asp:radiobutton (VB.net)
7.Radio button auto post back (C#)
8.Watch TextBox, CheckBox and radiobutton auto post back action (C#)
9.Use 'Switch' to read Radio Button Choice (C#)
10.Get selected RadioButton (C#)
11.Read RadioButton selection (C#)