Radio button checked change event

Posted by Rajasekhar0544 under ASP.NET on 12/28/2012 | Points: 10 | Views : 15802 | Status : [Member] | Replies : 3
Hi,

I have three radiobuttons, on checked changed event i want some textboxes or dropdowns visibility false.
The event is firing but after the button click.

Thanks&Regards,
RajSekhar.




Responses

Posted by: Pavanandey on: 12/28/2012 [Member] Bronze | Points: 25

Up
0
Down
Check whether radibuttion postback propery is set to true

Thanks
Pavan Kumar
Mark Answer if this fits the need

Rajasekhar0544, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ranjeet_8 on: 12/28/2012 [Member] [MVP] Gold | Points: 25

Up
0
Down
Try this,
Add this code on .ASPX page

<asp:RadioButton ID="RadioButton1" runat="server" AutoPostBack="True" Text="Display False"
oncheckedchanged="RadioButton1_CheckedChanged" GroupName="R1"/>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
<asp:RadioButton ID="RadioButton2" runat="server" AutoPostBack="True" Text="Display True"
oncheckedchanged="RadioButton2_CheckedChanged" GroupName="R1" />

Add this code on .ASPX.CS page
 

protected void RadioButton1_CheckedChanged(object sender, EventArgs e)
{
TextBox1.Visible=false;
DropDownList1.Visible=false;
}
protected void RadioButton2_CheckedChanged(object sender, EventArgs e)
{
TextBox1.Visible = true;
DropDownList1.Visible = true;
}


Please Mark As Answer if this helps you

.

Rajasekhar0544, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shipramaurya on: 12/28/2012 [Member] Starter | Points: 25

Up
0
Down
If you have multiple radioButtons in ur page u can also use RadioButtonList
It is also same as that of Radio Buttons .. iN RadioButton u can add items similarly as we do in DropDownList.

Even we can apply dynamic data binding to similarly like Dropdownlist


@Shipra - S.M. Techie

Rajasekhar0544, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response