C#/ASP.NET中服务器控件执行客户端代码的问题。。。急用啊。
C#/ASP.NET中服务器控件执行客户端代码,有几种方法都可以,
比如:
<HTML>
<HEAD>
<title> DoubleSidesHandler </title>
<script language= "javascript ">
function submitClientHandler()
{
if(XXX)
{
return false;
}
return true;
}
function initHandler()
{
var elem = document.form1.btnSubmit;
if(elem)
{
elem.onclick = submitClientHandler;
}
}
</script>
</HEAD>
<body onload= "initHandler() ">
<form id= "form1 " method= "post " runat= "server ">
<asp:Button ID= "btnSubmit " Text= "Submit " Runat= "server " OnClick= "SubmitServerHandler "> </asp:Button>