大家看一下是什么原因? Button2.Attributes.Add("onclick","return button2_click();");这一句是否放在 page_load中 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 是啊!问题是fuction button2_click(){ return confirm("...");}就有反应了是不是if(IsEmpty(cart.TextBox2.value)) { alert("...."); return false; } else return confirm (".....");写错了啊,我不懂javascript谢谢指点!! 你这个函数应该是实现空校验的吧,我给一段我的函数你,alert("....");应该是用单引号不是用双引号,先是html页面那里写(Form1send为form的id txt_idinput为textbox的id) function get_html() { if(document.Form1send.txt_idinput.value=='' ) { alert('id不能空') return false; } else { return true; } } 然后在pageload事件上写 btnsend.Attributes("onclick") = "return get_html();" 你的txt_idinput不是web控件吧,而是html控件吧?好象web控件不能这样啊!不知道该怎么写啊? 1.没有IsEmpty,js编译出错解决方法:function IsEmpty(str){return str.replace(/(^\s*|\s*$)/g,"")==""}2.没有设置CausesValidation="false"Validation和onclick冲突解决方法:function document.all.Button2.onclick(){return button2_click();} Extjs的combobox使用jsonstore获取asp.net后台数据 限制单个IP数量访问 请教 DataSet取出数据后,数据使用问题,请教 类似(安居客、淘宝网),查询条件用链接,页面元素重新加载问题 C#.net程序源码打包问题? RequiredFieldValidator控件问题! 警告 2 验证 (XHTML 1.0 Transitional): 不支持元素“embed”。 互联网地址如何下载内网的文件? 不是高手的不要进,不是高手的不要回答 通过ie自动安装office web component的问题?@< 高手,帮帮忙--》如何自动发布?
fuction button2_click()
{
return confirm("...");
}
就有反应了
是不是
if(IsEmpty(cart.TextBox2.value))
{
alert("....");
return false;
}
else
return confirm (".....");
写错了啊,我不懂javascript
谢谢指点!!
{
if(document.Form1send.txt_idinput.value=='' )
{
alert('id不能空')
return false;
}
else
{
return true;
}
}
然后在pageload事件上写
btnsend.Attributes("onclick") = "return get_html();"
好象web控件不能这样啊!
不知道该怎么写啊?
解决方法:
function IsEmpty(str){
return str.replace(/(^\s*|\s*$)/g,"")==""
}
2.没有设置CausesValidation="false"
Validation和onclick冲突
解决方法:
function document.all.Button2.onclick(){
return button2_click();
}