有没有办法改aspx生成的__doPostBack()中的代码?大侠请进
aspx默认生成的发往客户端的html代码如下:
function __doPostBack(eventTarget, eventArgument) {
var theform;
if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
theform = document.forms["Form1"];
}
else {
theform = document.Form1;
}
theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
我想把它改为生成下面的代码(总共加了三行):
function __doPostBack(eventTarget, eventArgument) {
if(a==false){ //这一行是我加的
a = true; //这一行是我加的
var theform;
if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
theform = document.forms["Form1"];
}
else {
theform = document.Form1;
}
theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}//这个括号也算一行把,也是我加的
}
至于用到的哪个变量a,我可以直接在aspx页面中用javascript声明一下,如:
<script language="javascript">
var a=false;
</script>
我想通过这个方法实现让一个web控件的回发阻止此页面上所有其他web控件的回发,知道回发处理完成为止。