asp.net复选框,单击 [英] asp.net checkbox click

查看:73
本文介绍了asp.net复选框,单击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想启用只有一个复选框选中第九我的按钮.

i want to enable my button only if one checkbox ix checked.
what will be the code?

推荐答案

首先,您需要将按钮"visiblity"属性值设置为"false".然后,以下代码将为您提供帮助

First you need to set the button ''visiblity'' property value to ''false''. Then following code will help you

protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
       {
           if (CheckBox1.Checked)
               Button1.Visible = true;
           else
               Button1.Visible = false;
       }


您需要修改属性Button.Enabled

文字示例:
http://www.daniweb.com/software-development/csharp/threads/69547/a-simple-question-how-to-enabled-ableisable-a-button-at-runtime [ www.youtube.com/watch?v=rnI1AQcmJnI [
You need to modify the property Button.Enabled

Examples in text:
http://www.daniweb.com/software-development/csharp/threads/69547/a-simple-question-how-to-enabledisable-a-button-at-runtime[^]

Little video tutorial:
www.youtube.com/watch?v=rnI1AQcmJnI[^]


这篇关于asp.net复选框,单击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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