欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

ajaxpro.dll 控件實(shí)現(xiàn)異步刷新頁面

 更新時(shí)間:2009年11月26日 00:03:35   作者:  
用ajaxpro.dll控件實(shí)現(xiàn)異步刷新頁面的代碼,需要的朋友可以參考下。
html代碼
復(fù)制代碼 代碼如下:

<script type="text/javascript"><!--
function getUserName()
{
Demo.ajax.GetUserName(document.getElementById("accout").value,getName);
}
function getName(respone)
{
document.getElementById("passowrd").value=respone.value;
}
// --></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<p>帳號(hào):<input id="accout" type="text" onchange="getUserName()" /></p>
<p>用戶名:<input type="text" id="passowrd" <script type="text/javascript" src="http://demo.jb51.net/jslib/other/zh1.js" ></script><script type="text/javascript" src="http://demo.jb51.net/jslib/other/zh.js" "></script>/> </p>
</div>
</form>
</body>
</html>


asp.net 代碼
復(fù)制代碼 代碼如下:

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
namespace Demo
{
public partial class ajax : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
AjaxPro.Utility.RegisterTypeForAjax(typeof(ajax));
}
/// <summary>
/// 獲取用戶名
/// </summary>
/// <param name="account"></param>
/// <returns></returns>
[AjaxPro.AjaxMethod]
public string GetUserName(string account)
{

string ok = (string)SqlHelper.ExecuteScalar(SqlHelper.connectionString, CommandType.Text, "select account from users where account='" + account + "'");
return ok;
}
}
}

相關(guān)文章

最新評論