是这样的..我从某本书上看到一个用户注册中使用Ajax的示范,但是代码并不完整,而我基础也差=A="求各位指导一下首先InputMessage.ascx控件里面 了提示信息的三中状态 正常的说明文字TipsWord,验证成功TipsOk,验证失败TipsError然后在在注册页面中定义了UpdatePanel的AsyncPostBackTrigger,引发了textbox的"TextChanged"事件 protected void txtPersonNO_TextChanged(object sender, EventArgs e)
{
this.CheckPN();
}
private bool CheckPN()
{
bool result = false;
string check = "1";
//string check = this.PageGuest.CheckPersonName(this.txtPersonNo.Text);
if (check == string.Empty)
{
this.imPN.TipsOk = "该用户名可用";
result = true;
}
else
this.imPN.TipsError = check;
this.upPN.Update();
return result;
}红字部分因是我为了测试效果添加的,
绿字部分为原文的代码..我想用liqDataSource控件把数据连接起来..
于是我在aspx页面放了一个linqDataSource控件 把数据配置好,请问绿字部分要怎么写才能让check得到查询的结果..?
{
this.CheckPN();
}
private bool CheckPN()
{
bool result = false;
string check = "1";
//string check = this.PageGuest.CheckPersonName(this.txtPersonNo.Text);
if (check == string.Empty)
{
this.imPN.TipsOk = "该用户名可用";
result = true;
}
else
this.imPN.TipsError = check;
this.upPN.Update();
return result;
}红字部分因是我为了测试效果添加的,
绿字部分为原文的代码..我想用liqDataSource控件把数据连接起来..
于是我在aspx页面放了一个linqDataSource控件 把数据配置好,请问绿字部分要怎么写才能让check得到查询的结果..?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货