Click here to Skip to main content
15,914,416 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have three radio button of same group, I want to Insert some data in a text box according to the selection of radio button.
I am trying this, but control is not going inside the OnCheckChanged method.
please anyone help me
Posted
Comments
Tom Marvolo Riddle 28-Jan-14 4:03am    
Post your code snippet
Soumitra Mithu 28-Jan-14 5:50am    
post your code what you tried.

Hi
Kindly set the property AutoPostBack of the RadioButton to True.

VB
<asp:RadioButton ID="RadioButton1" AutoPostBack="true"  runat="server"
            oncheckedchanged="RadioButton1_CheckedChanged" />
 
Share this answer
 
C#
protectedvoid RadioButton1_CheckedChanged(object sender, EventArgs e)
{
    if (RadioButton1.Checked)
    {
        TextBox1.Text = "a";
    }
}
protectedvoid RadioButton2_CheckedChanged(object sender, EventArgs e)
{
    if (RadioButton2.Checked)
    {
        TextBox1.Text = "b";
    }
}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900