RadioButton group example: how to use RadioButton array / group in asp.net

<%@ Page Language=”C#” %>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1-transitional.dtd”&gt;

<script runat=”server”>
protected void RadioButton_CheckedChanged(object sender,System.EventArgs e) {
if (RadioButton1.Checked == true)
{
Response.Write(“You Selected: Asp.Net”);
}
else {
Response.Write(“You Selected: ColdFusion”);
}
}
</script>

<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head runat=”server”>
<title>RadioButton example: how to use RadioButton control in asp.net</title>
</head>

<body>
<form id=”form1″ runat=”server”>
<div>
<asp:RadioButton ID=”RadioButton1″ runat=”server” Text=”Asp.Net” GroupName=”Software” AutoPostBack=”true” OnCheckedChanged=”RadioButton_CheckedChanged” />
<asp:RadioButton ID=”RadioButton2″ runat=”server” Text=”ColdFusion” GroupName=”Software” AutoPostBack=”true” OnCheckedChanged=”RadioButton_CheckedChanged” />
</div>
</form>
</body>
</html>

 

 

 

 

 

Reference: http://asp-net-example.blogspot.com/2008/10/radiobutton-example-how-to-use.html

Advertisements
By simplemsexchange Posted in ASP.NET

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s