调用JavaScript客户端验证功能和服务器端功能

调用JavaScript客户端验证功能和服务器端功能

问题描述:





如何在点击asp.net按钮控件时调用javascript客户端功能。



如果客户端有效仅意味着只有onclick事件函数称为



否则对客户端错误非常贴心



给我代码或任何有用的链接

Hi,

How to calling javascript client side function while clicking asp.net button control.

If client side valid only means then only onclick event function called

otherwise intimate to client error

Give me code or any good link for this

检查clent side event是否返回true。如果它重新生成false,则停止服务器端事件触发

Check if clent side event returns true of flase. IF it restruns false then stop the server side event to fire

检查以下示例

 <script type="text/javascript">        function CheckValidate() {          IF it satisfies the condition then return true            return true;         else             return false;        }    </script>In Button  write like this<asp:Button ID="btnSubmit" runat="server" OnClientClick="return CheckValidate()" onclick="btnSubmit_Click" Text="Cleck Here" />