首页 > 代码库 > 表单验证(ASP.NET+jquery.validationEngine.js)

表单验证(ASP.NET+jquery.validationEngine.js)

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>MyKit</title>
<link href="http://www.mamicode.com/css/Style.css" rel="stylesheet" type="text/css" />
<link href="http://www.mamicode.com/css/validationEngine.jquery.css" rel="stylesheet" />
<script src="http://www.mamicode.com/js/jquery-2.1.0.js"></script>
<script src="http://www.mamicode.com/js/jquery.validationEngine-zh_CN.js"></script>
<script src="http://www.mamicode.com/js/jquery.validationEngine.min.js"></script>
<script type="text/javascript">
//表单验证
$(document).ready(function () {
$("#form1").validationEngine();
});

</script>
</head>
<body class="l_main">
<form id="form1" runat="server">
<div class="l_border">
<asp:Label ID="lbl_uname" runat="server" Text="用户名:"></asp:Label>
<asp:TextBox ID="txt_uname" runat="server" ToolTip="请输入用户名!" Width="180px" class="validate[required] text-input"></asp:TextBox>
<br />
<asp:Label ID="lbl_pwd" runat="server" Text="密码:"></asp:Label>
<asp:TextBox ID="txt_pwd" runat="server" ToolTip="请输入密码!" TextMode="Password" Width="180px" class="validate[required] text-input"></asp:TextBox>
<br />
<span></span>
<asp:Button ID="Button1" runat="server" Text="登录" Width="185px" OnClick="btn_login_Click"/>
</div>
</form>
</body>
</html>