web 2.0

ASP.NET(vb.net) & RadioButton - asp:RadioButton

ASP.NET(vb.net) & RadioButton - asp:RadioButton - asp:RadioButton : Creates an individual radio button on the page. You can group multiple radio buttons together to provide a mutually exclusive set of choices.

ShotDev Focus:
- ASP.NET(vb.net) & RadioButton - asp:RadioButton

ASP.NET(vb.net) & RadioButton - asp:RadioButton

Tag Control :

  1. <asp:RadioButton id="RadioButton1"  
  2. AutoPostBack="True|False"  
  3. Checked="True|False"  
  4. GroupName="GroupName"  
  5. Text="label"  
  6. TextAlign="Right|Left"  
  7. OnCheckedChanged="OnCheckedChangedMethod"  
  8. runat="server"/>  

Example

RadioButton.aspx

  1. <%@ Page Language="VB" %>  
  2. <script runat="server">  
  3.   
  4. Sub Button1_Click(sender As Object, e As EventArgs)  
  5. IF Me.RadioButton1.Checked = True Then  
  6. Me.lblText1.Text = "Option 1 Checked"  
  7. End IF  
  8. IF Me.RadioButton2.Checked = True Then  
  9. Me.lblText1.Text = "Option 2 Checked"  
  10. End IF  
  11. End Sub  
  12.   
  13. Sub RadioButton3_CheckedChanged(sender As Object, e As EventArgs)  
  14. IF Me.RadioButton3.Checked = True Then  
  15. Me.lblText2.Text = "Option 3 Checked"  
  16. End IF  
  17. End Sub  
  18.   
  19. </script>  
  20. <html>  
  21. <head>  
  22. <title>ShotDev.Com Tutorial</title>  
  23. </head>  
  24. <body>  
  25. <form runat="server">  
  26. <asp:RadioButton id="RadioButton1" runat="server" text="Option 1" GroupName="Group1"></asp:RadioButton>  
  27. <asp:RadioButton id="RadioButton2" runat="server" text="Option 2" GroupName="Group1"></asp:RadioButton>  
  28. <br>  
  29. <asp:RadioButton id="RadioButton3" runat="server" text="Option 3" GroupName="Group2" AutoPostBack="true" OnCheckedChanged="RadioButton3_CheckedChanged"></asp:RadioButton>  
  30. &nbsp;  
  31. <asp:Button id="Button1" onclick="Button1_Click" runat="server" Text="Button"></asp:Button>  
  32. <hr />  
  33. <asp:Label id="lblText1" runat="server"></asp:Label>  
  34. <br>  
  35. <asp:Label id="lblText2" runat="server"></asp:Label>  
  36. </form>  
  37. </body>  
  38. </html>  

Screenshot

ASP.NET(vb.net) & RadioButton - asp:RadioButton
.
.
.
Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (No Ratings Yet)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.