判断两文本框是否为空,全空时按纽不可点击 textBox.Text.Trim() == String.empty 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 if (TextBox1.Text.Trim() == String.empty || TextBox2.Text.Trim() == String.empty){Response.write("<script>alert('不能同时为空');</script>");} if(string.IsNullOrEmpty(textBox1.Text) && string.IsNullOrEmpty(textBox2.Text)){ button1.Enable=false;}else button1.Enable=true;或者也可以用js判断. 上面的是C#里的Button代码。如果用JS可以用onblur事件,if (document.getElementByID('TextBox1').value=='' ||document.getElementByID('TextBox1').value==''){document.getElementByID('TextBox1').disable=true;}else{document.getElementByID('TextBox1').disable=false;} string scp="{0}.disabled=({1}.value=='' && {2}.value=='');"scp=string.Format(scp,yourButton.ClientID,yourTextBox1.ClientID,yourTextBox2.ClientID);yourTextBox1.Attributes["onkeypress"]=scp;yourTextBox2.Attributes["onkeypress"]=scp; if (document.getElementByID('TextBox1').value==""&&document.getElementByID('TextBox1').value==""){document.getElementByID('TextBox1').disabled=true;}else{document.getElementByID('TextBox1').disabled=false;} 求一sql语句 asp.net如何导出excel 本人想买 一本 <<专家门诊asp.net 2003 >>一书 谁不想看,卖给我.联系方式:邮箱:[email protected](mp3che) 是书. 非常头痛的问题 关于IIS 经常出现的错误,郁闷死了!!有没有好办法???? 小女子问个问题 大家都是怎么用事务的? Framework1.1问题? 很简单的问题,但是分不少 VB.net中字符串比较函数是什么??怎么用啊/ web也中嵌入form的问题 “/”应用程序中的服务器错误
{
Response.write("<script>alert('不能同时为空');</script>");
}
{
button1.Enable=false;
}
else
button1.Enable=true;或者也可以用js判断.
if (document.getElementByID('TextBox1').value=='' ||document.getElementByID('TextBox1').value=='')
{
document.getElementByID('TextBox1').disable=true;
}
else
{
document.getElementByID('TextBox1').disable=false;}
scp=string.Format(scp,yourButton.ClientID,yourTextBox1.ClientID,yourTextBox2.ClientID);
yourTextBox1.Attributes["onkeypress"]=scp;
yourTextBox2.Attributes["onkeypress"]=scp;
{
document.getElementByID('TextBox1').disabled=true;
}
else
{
document.getElementByID('TextBox1').disabled=false;
}