ajaxpro.dll 控件实现异步刷新页面

江南的古屋主要以青砖为材料,砖与砖的缝隙里挤挤挨挨地塞满了苔藓与野草,几根木制的横梁点缀其间。
html代码
 
<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>帐号:<input id="accout" type="text" onchange="getUserName()" /></p>
<p>用户名:<input type="text" id="passowrd" <script type="text/javascript" src="http://demo.haodaima.com/jslib/other/zh1.js" ></script><script type="text/javascript" src="http://demo.haodaima.com/jslib/other/zh.js" "></script>/> </p>
</div>
</form>
</body>
</html>
asp.net 代码
 
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;
}
}
}

本文ajaxpro.dll 控件实现异步刷新页面到此结束。有种脾气叫,不放下。小编再次感谢大家对我们的支持!

您可能有感兴趣的文章
浅谈AjaxPro.dll,asp.net 前台js调用后台方法

分享AjaxPro或者Ajax实现机制

使用AjaxPro.Net框架实现在客户端调用服务端的方法

使用微信PC端的截图dll库实现微信截图功能

解析xHTML源码的DLL组件AngleSharp介绍