用户名:
密 码: 记住
您当前的位置:首页 > 网络编程 > Net教程

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

时间:2015-01-29  来源:互联网  作者:佚名
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.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 代码
复制代码 代码如下:
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;
}
}
}
来顶一下
返回首页
返回首页
推荐资讯
asp.net FreeTextBox配置详解 asp.net FreeTextBox配置详解如图所示: 这就是我们在网页上编辑文字时经常使用的东西。
jQuery+Ajax用户登录功能的实现 jQuery+Ajax用户登录功能的实现ok,先来贴几张张效果图。其中大致流程是用户点击页面右上角
相关文章
    无相关信息
栏目更新
栏目热门