Ajax in UserControl

删除回忆录丶 提交于 2019-12-02 17:59:37

问题


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

how can i do that?


回答1:


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.

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

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



来源:https://stackoverflow.com/questions/2661723/ajax-in-usercontrol

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!