当前位置:编程学习 > C#/ASP.NET >>

帮我看看这按纽怎么enable老是false呢?

if (string.IsNullOrEmpty(txtDName.Text) && string.IsNullOrEmpty(ipAdd.Text) && string.IsNullOrEmpty(userName.Text) 
        {
            this.Button1.Enabled = false;
           
        }
        else
        {
           
            this.Button1.Enabled = true;
        }
是不是要加文本textchange事件啊? --------------------编程问答-------------------- 加前端的textbox onchange事件,用javascript控制。后端得不到的 --------------------编程问答-------------------- 只能说是你判断的结果一直都是执行
this.Button1.Enabled = false; --------------------编程问答-------------------- textchange事件太麻烦,把你那三个文本框的AutoPostBack属性设为true就可以达到楼主想要的效果. --------------------编程问答-------------------- 好复杂
应该一直运行else语句 --------------------编程问答-------------------- 3个判断结果都是什么啊?怀疑楼主的条件问题 --------------------编程问答-------------------- 怀疑楼主的条件问题
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,