做一个简单的登录页面,用Ajax.dll,
var v_username=document.getElementById("username").value;
var v_pwd=document.getElementById("password").value ;
//alert( v_username+" "+ v_pwd);
if(v_username == "" || v_pwd == "")
{
alert("用户名和密码不能为空!");
return ;
}
var val=AjaxLogin.GetValue(v_username,v_pwd).value;
if(val == 'failure')
{
alert("用户名密码不正确,请重新输入!");
return ;
}
else
{
alert("success!");
window.location.href="http://www.sina.com";
}
为什么成功后就是不跳转,搞不懂。。重新刷新本页面。。
怎么做跳转?
var v_username=document.getElementById("username").value;
var v_pwd=document.getElementById("password").value ;
//alert( v_username+" "+ v_pwd);
if(v_username == "" || v_pwd == "")
{
alert("用户名和密码不能为空!");
return ;
}
var val=AjaxLogin.GetValue(v_username,v_pwd).value;
if(val == 'failure')
{
alert("用户名密码不正确,请重新输入!");
return ;
}
else
{
alert("success!");
window.location.href="http://www.sina.com";
}
为什么成功后就是不跳转,搞不懂。。重新刷新本页面。。
怎么做跳转?
Ajax.Utility.RegisterTypeForAjax(typeof(KelinWeb.AjaxLogin));//在if (!IsPostBack)外在AjaxLogin.cs业务类里是sql语句查询就是成功不跳转window.location.href="http://www.sina.com"; 还会page load()本页刷新
第一次用ajax.dll