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="/UploadFiles/2021-04-02/zh1.js"></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;
}
}
}
复制代码 代码如下:
<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="/UploadFiles/2021-04-02/zh1.js"></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,异步刷新
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
狼山资源网 Copyright www.pvsay.com
暂无“ajaxpro.dll 控件实现异步刷新页面”评论...