前台代码:
<script>
function zc() {
//if (checkphone() == 0 || pswordst() == 0 || checkpsd == 0) {
// alert("注册失败!请检查信息是否填写完整");
//}
//else {
// //var formParam = $("user_fm").serialize();
// $("#zhuc").bind("click", function () {
$.ajax({
type: 'post',
contentType:'appliction/json',
url: 'Jqueryaccept.aspx',
data: "{'phone':'" + $("#Phone").val() + "','psword':'" + $("#psword").val() + "','psword1':'" + $("#psword1").val() + "'}",
cache: false,
datatype: JSON,
success: function (data) {
if (data) {
alert("注册成功!");
}
else
alert("注册失败!请检查信息是否填写完整!");
},//success表示成功返回
error: function () {
alert("网络出现问题!");
}
});
// });
//}
}
</script>
后台代码:
protected void Page_Load(object sender, EventArgs e)
{
string phone = Request.Form["phone"];
string psword=Request.Form["psword"];
string psword1 = Request.Form["psword1"];
Response.Write("true");
}
Jqueryaccept.aspx的前台页面需为空。