本文介绍了点击RadioButton重新载入页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有三个相同组的单选按钮,我想根据单选按钮的选择在文本框中插入一些数据。

我正在尝试这个,但控制权不在OnCheckChanged方法。

请有人帮帮我

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

推荐答案

<asp:RadioButton ID="RadioButton1" AutoPostBack="true"  runat="server"
            oncheckedchanged="RadioButton1_CheckedChanged" />


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";
    }
}


这篇关于点击RadioButton重新载入页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 13:42