同第一个例子一样,前面的准备工作就不再陈述了。
       新建一个项目,命名为ajax,在WebForm1.aspx.cs文件的Page_Load()事件里注册:
1基于Ajax.net的验证private void Page_Load(object sender, System.EventArgs e)
2        }
然后开始服务器端的编程,写入如下的函数:
 1基于Ajax.net的验证private bool IsusernameExit(string strusername)
 2        }
这些是服务器端的函数,那么接下来就是客户端的编程,在WebForm1.aspx的HTML页面的<head></head>区域里
写入以下的函数:
 1基于Ajax.net的验证<script language="javascript">
 2基于Ajax.net的验证    function username()
 3>
恩,这样就差不多了,根据上面的代码,再在页面上拖几个相关的控件,就可以了,下面给出完整的代码
Webform1.aspx.cs
 1基于Ajax.net的验证using System;
 2基于Ajax.net的验证using System.Collections;
 3基于Ajax.net的验证using System.ComponentModel;
 4基于Ajax.net的验证using System.Data;
 5基于Ajax.net的验证using System.Drawing;
 6基于Ajax.net的验证using System.Web;
 7基于Ajax.net的验证using System.Web.SessionState;
 8基于Ajax.net的验证using System.Web.UI;
 9基于Ajax.net的验证using System.Web.UI.WebControls;
10基于Ajax.net的验证using System.Web.UI.HtmlControls;
11基于Ajax.net的验证using System.Text.RegularExpressions;
12基于Ajax.net的验证namespace ajax
13
Webform1.aspx代码:
 1
 恩,这个例子没有涉及到数据库,当然了,只是个简单的引入。以后的工作量还是很大的。


相关文章: