SiteMap  | About    

RadioButton Control

Radio button allows the user to choose only one of a predefined set of options. When a user clicks on a radio button, it becomes checked, and all other radio buttons with same group become unchecked. The buttons are grouped logically if they all share the same GroupName property.


  RadioButton1.Checked = True


  RadioButton1.Checked = true;

Use a radio button when you want the user to choose only one option. When you want the user to choose all appropriate options, use a check box.

The following ASP.NET program gives three option button to select. When the user select any option button , the label control displays the which option button is selected.



<html xmlns="">
<head id="Head1" runat="server">
	<title>Untitled Page</title>
	<form id="form1" runat="server">
		<asp:RadioButton ID="RadioButton1" GroupName="language" runat="server" Text="ASP.NET" /><br />
		<asp:RadioButton ID="RadioButton2" GroupName="language" runat="server" Text="VB.NET" /><br />
		<asp:RadioButton ID="RadioButton3" GroupName="language" runat="server" Text="C#" /><br />
		<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" /><br />
		<asp:Label ID="Label1" runat="server" Text="Label1"></asp:Label>

Click the following links to see full source code

C# Source Code
VB.NET Source Code
default.aspx.vb (C) 2018    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.