RadioButton和CheckBox方法 [英] RadioButton and CheckBox Methods

查看:100
本文介绍了RadioButton和CheckBox方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在我的ASP.net网站上,我添加了RadioButton1和CheckBox1,
我设置了runat ="Server"的属性.

我分别在RadioButton1_CheckedChanged和CheckBox1_CheckedChanged方法中分别为RadioButton和CheckBox编写代码.


Hi,

In my ASP.net website, i added RadioButton1 and CheckBox1,
I set the property of runat = "Server" .

I write code in methods RadioButton1_CheckedChanged and CheckBox1_CheckedChanged for RadioButton and CheckBox respectively.


protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
    Label1.Text = "any thing";
}


protected void RadioButton1_CheckedChanged(object sender, EventArgs e)
{
    Label1.Text = "any thing";
}





但是调用者从不使用这些方法,为什么???????





but the caller never goes to these methods, Why???????

推荐答案

添加属性Autopostback ="true",例如:
< asp:CheckBox runat ="server" AutoPostBack ="true"/>


祝你好运.
Add property Autopostback="true" like:
<asp:CheckBox runat="server" AutoPostBack="true" />


Good luck.


这篇关于RadioButton和CheckBox方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆