您的位置:首页 > 其它

一个简单AJAX注册示例

2008-08-26 11:26 399 查看
前台页面代码:

Code

<%@ WebHandler Language="C#" Class="Handler" %>

using System;

using System.Web;

public class Handler : IHttpHandler {

public void ProcessRequest (HttpContext context) {

context.Response.ContentType = "text/plain";

string flag = context.Request.QueryString["flag"];

if (flag == "" || flag == null)

return;

if (flag.Equals("addAdmin"))

{

string userName = context.Request.QueryString["userName"].ToString();

if (userName == "test")

{

context.Response.Write("该用户已经存在");

}

else

{

context.Response.Write("你可以注册[" + userName + "]");

}

}

else if (flag.Equals("updateTitle"))

{

}

}

public bool IsReusable {

get {

return false;

}

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: