阿贾克斯在用户控件 [英] Ajax in UserControl

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

问题描述

我有一个注册页面,我想检查用户名是否存在或不使用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.

您想要什么样的阿贾克斯也用? MS阿贾克斯,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.

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

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