日期:2014-05-16 浏览次数:20885 次
<%@ Page Language="C#"AutoEventWireup="true"CodeBehind="Login.aspx.cs"Inherits="HISWEB.Login"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1"runat="server">
<meta http-equiv="Content-Type"content="text/html;charset=utf-8">
<title>系统登录</title>
<link rel="stylesheet"href="css/layout.css"type="text/css"media="all"charset="utf-8"/>
<link rel="stylesheet"href="css/validationEngine.jquery.css"type="text/css"/>
<link rel="stylesheet"href="css/template.css"type="text/css"/>
<script src="js/jquery-1.4.1.min.js"type="text/javascript"charset="utf-8"></script>
<script src="js/jquery.infieldlabel.min.js"type="text/javascript"charset="utf-8"></script>
<script src="js/jquery.validationEngine-cn.js"type="text/javascript"charset="utf-8">
</script>
<script src="js/jquery.validationEngine.js"type="text/javascript"charset="utf-8"></script>
<script type="text/javascript"charset="utf-8">
$(function() { $("label").inFieldLabels(); });
</script>
<script type="text/javascript">
varis_login = false;
jQuery(document).ready(function() {
jQuery("#formID").validationEngine();
});
//无参数调用
$(document).ready(function() {
$('#btn').click(function() {
$.ajax({
type: "POST", //访问WebService使用Post方式请求
contentType: "application/json", //WebService 会返回Json类型
url: "WebService.asmx/is_Login", //调用WebService的地址和方法名称组合 ---- WsURL/方法名
data: "{ jzkh:"+ $('#jzkh').val() + ",pwd:"+ $('#pwd').val() + " }", //这里是要传递的参数,格式为 data: "{paraName:paraValue}",下面将会看到
dataType: 'json',
//async: false, //同步 async: false,默认 async: true
success: function(result) { //回调函数,result,返回值
is_login = result.d;
if(is_login == true) { $('#t').append("登录成功!!!"); }
else{ $('#t').append("登录失败!!!"); }
}
});
});
});
</script>
<!--[iflte IE 6]>
<style type="text/css"media="screen">
form label {
background: #fff;
}
</style>
<![endif]-->
</head>
<body>
<h1>
系统登录</h1>
<form id="formID"runat="server">
<fieldset>
<p>
<label for="jzkh">
卡号</label><br />
<input type="text"name="jzkh"value=""id="jzkh"
class="validate[required,custom[onlyNumberSp],custom[onlyLetterNumber],maxSize[20]] text-input">
</p>
<p>
<label for="pwd">
密码</label><br />
<input type="password"name="pwd"value=""id="pwd"
class="validate[required,custom[onlyLetterNumber],maxSize[20]] text-input">
</p>
</fieldset>
<button type="button"id="btn">
登录</button>
<p style="font-size: xx-small; text-align: right"> </p>
<div id="t">
</div>
</form>
</body>
</html>
using System;
using System.Data;
using