Ajax in UserControl(用户控件中的 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:用户控件中的 Ajax


基础教程推荐
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01