用户控件中的 Ajax [英] Ajax in UserControl

查看:18
本文介绍了用户控件中的 Ajax的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个注册页面,我想用 ajax 检查用户名是否存在

i have a signup page and i want to check username exists or not with ajax

 <%@ Control Language="C#" AutoEventWireup="true" CodeFile="Simple.ascx.cs" Inherits="UserControls_Simple" %>
<div style="direction:rtl;">
<table style="font-family:Tahoma;font-size:12px;width:200px;">
<tr>
<td>نام کاربری:</td>
<td><asp:TextBox ID="txtUserName" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td>
    <asp:Label ID="lblMessage" runat="server" Text="Username Already Exists" Visible="False"></asp:Label>
</td>
<td>
</td>
</tr>
<tr>
<td>کلمه عبور</td>
<td><asp:TextBox ID="txtPassword" runat="server"></asp:TextBox></td>
</tr>
</table>
</div>

如果用户存在,我想显示标签

i want to show label if user exists

我该怎么做?

推荐答案

使用 Ajax 通过用户控件(或您使用的任何方法)检查​​数据库中是否存在用户与您在 Web 中使用的方法相同页.

Using Ajax to check if a user exists in your DB via a User Control (or whatever method you are using) is the same method you would use in a Web Page.

您想使用哪种 Ajax?MS Ajax,jQuery,什么?

What kind of Ajax do you want to use? MS Ajax, jQuery, what?

无论如何,您都需要从客户端脚本调用 Web 服务 执行 AJAX 请求.

Regardless, you will need to Call Web Services from Client Script to perform an AJAX request.

这篇关于用户控件中的 Ajax的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆