TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Nitin Sharma
NA
154
61.6k
how radiobutton checkchanged event work in asp.net webform
Mar 18 2014 9:08 AM
can anybody tell me that how radiobutton checkchanged event work in asp.net webform.
my coding is working in windows form but same coding is not working in webform. i m pasting my code
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.style1
{
width: 100%;
}
.style2
{
width: 184px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table class="style1">
<tr>
<td class="style2">
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
<asp:RadioButton ID="RadioButton1" runat="server" GroupName="a"
oncheckedchanged="RadioButton1_CheckedChanged" />
</td>
<td>
<asp:Button ID="Button1" runat="server" Text="Button" Visible="False" />
</td>
</tr>
<tr>
<td class="style2">
<asp:RadioButton ID="RadioButton2" runat="server" GroupName="a"
oncheckedchanged="RadioButton2_CheckedChanged" />
</td>
<td>
<asp:Button ID="Button2" runat="server" Text="Button" Visible="False" />
</td>
</tr>
<tr>
<td class="style2">
<asp:RadioButton ID="RadioButton3" runat="server" GroupName="a"
oncheckedchanged="RadioButton3_CheckedChanged" />
</td>
<td>
<asp:Button ID="Button3" runat="server" Text="Button" Visible="False" />
</td>
</tr>
<tr>
<td class="style2">
</td>
<td>
</td>
</tr>
<tr>
<td class="style2">
</td>
<td>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void RadioButton1_CheckedChanged(object sender, EventArgs e)
{
if (RadioButton1.Checked == true)
{
Button1.Visible = true;
Button2.Visible = false;
Button3.Visible = false;
RadioButton2.Checked = false;
RadioButton3.Checked = false;
}
}
protected void RadioButton2_CheckedChanged(object sender, EventArgs e)
{
if (RadioButton2.Checked == true)
{
Button1.Visible = false;
Button2.Visible = true;
Button3.Visible = false;
RadioButton1.Checked = false;
RadioButton3.Checked = false;
}
}
protected void RadioButton3_CheckedChanged(object sender, EventArgs e)
{
if (RadioButton3.Checked == true)
{
Button1.Visible = false;
Button2.Visible = false;
Button3.Visible = true;
RadioButton1.Checked = false;
RadioButton2.Checked = false;
}
}
}
Reply
Answers (
6
)
how to use capture image control in registration form
dotnet general