手机
当前位置:查字典教程网 >编程开发 >asp.net教程 >使用updatepanel局部刷新实现注册时对用户名的检测示例
使用updatepanel局部刷新实现注册时对用户名的检测示例
摘要:通过将控件放入到updatepanel中,实现局部刷新。前台代码:复制代码代码如下://必须有且写在updatepanel前面后台代码:复制...

通过将控件放入到updatepanel中,实现局部刷新。

前台代码:

复制代码 代码如下:

<asp:ScriptManager ID="ScriptManager1" runat="server">

</asp:ScriptManager> //必须有且写在updatepanel前面

<asp:updatepanel runat="server" id="updatepanel1">

<contenttemplate>

<asp:textbox runat="server" id="txtname"></asp:textbox>

<asp:button runat="server" id="btn" text="检测"></asp:button>

<asp:label runat="server" id="tip"></asp:label>

</contenttemplate>

</asp:updatepanel>

后台代码:

复制代码 代码如下:

protected void btn_Click(object sender, EventArgs e)

{

if (this.txtname.Text == "user1")

{

this.tip.Text = "用户名已存在";

}

else

{

this.tip.Text = "用户名可用";

}

}

【使用updatepanel局部刷新实现注册时对用户名的检测示例】相关文章:

asp.net实现在线音乐播放器示例

php使用socket编程示例

asp.net下用js实现鼠标移至小图,自动显示相应大图

asp.net模板引擎Razor调用外部方法用法实例

使用ajax局部刷新gridview进行数据绑定示例

.Net 如何限制用户登录的方法

asp.net用三层实现多条件检索示例

EasyUI Tree+Asp.net实现权限树或目录树导航的简单实例

asp.net中利用Jquery+Ajax+Json实现无刷新分页的实例代码

使用Lucene.NET实现站内搜索

精品推荐
分类导航