散分啦!!!!!!
怎么样在不刷新页面的情况下保存下密码??
------解决方案--------------------ajax
------解决方案--------------------ajax.asp.net下载ajax框架,利用里面的UpdatePanel控件实现
------解决方案--------------------//客户端登录页面 Login.aspx ;代码如下
<HTML>
<HEAD>
<title> HelloWorld </title>
<meta name= "GENERATOR " Content= "Microsoft Visual Studio .NET 7.1 ">
<meta name= "CODE_LANGUAGE " Content= "C# ">
<meta name= "vs_defaultClientScript " content= "JavaScript ">
<meta name= "vs_targetSchema " content= "http://schemas.microsoft.com/intellisense/ie5 ">
<script language= "jscript " src= "../Javascript/CallBackObject.js "> </script>
<script language= "jscript ">
function createRequest()
{
var name = escape(document.getElementById( "name ").value);
var pass = escape(document.getElementById( "pwd ").value);
var cbo = new CallBackObject();
cbo.OnComplete = Cbo_Complete;
cbo.onError = Cbo_Error;
cbo.DoCallBack( "Ajax.aspx?name= "+name+ "&password= "+pass);
}
function Cbo_Complete(responseText, responseXML)
{
alert(responseText);
}
function Cbo_Error(status, statusText, responseText)
{
alert(responseText);
}
</script>
</HEAD>
<body>
<form id= "Form1 " method= "post " runat= "server ">
<asp:Label id= "lblUsername " runat= "server " Width= "70 "> UserName: </asp:Label> <INPUT id= "name " style= "WIDTH: 192px; HEIGHT: 22px " type= "text " size= "26 ">
<br>
<asp:Label id= "lblPassword " runat= "server " Width= "70px "> Password: </asp:Label> <INPUT id= "pwd " style= "WIDTH: 192px; HEIGHT: 22px " type= "text " size= "26 ">
<br>
<input type= "button " value= "Login! " onclick= "createRequest() " style= "WIDTH: 128px; HEIGHT: 24px ">
</form>
</body>
</HTML>
服务器处理页面:AJAX.asp.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
namespace AjaxFrmClass
{
/// <summary>
/// AjaxTest 的摘要说明。
/// </summary>
public class AjaxTest : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
//show();
#region 用户登陆
switch(LoginVerify())
{
case "1 ":
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Write( "密码不正确 ");