查询在c#中搜索texbox的丢失焦点事件 [英] query Search on lost focus event of texbox in c#

查看:109
本文介绍了查询在c#中搜索texbox的丢失焦点事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好



在我的注册中,当新用户在文本框中选择用户名时,它应返回用户名是否存在。我想要那个功能。我该怎么办?

Hello

in my registration for when new user select username in textbox , it should return whether user name exists or not. i want that functionality. how can i do?

推荐答案

您可以使用ajax检查用户名的可用性。

点击此处使用ajax进行用户名可用性检查 [ ^ ]
You can check the username availability with ajax.
Check here Username availability check with ajax[^]


在本地Web服务上创建。在Web上创建方法到用户是否存在。在文本框onblur事件中调用此Web方法。

这将检查用户名是否存在asynchronusly&你的ui也不会被封锁。

参考此链接

http://www.semenoff.dk/en/Code-Corner/ASP.Net.AJAX/WebService-From-JavaScript.aspx



你也可以使用页面方法来实现这个目的

参考这个

http://www.dotnetcurry.com/ShowArticle.aspx?ID=109
Create on local web service. Create on web method in to user is present or not. Call this web method in textbox onblur event.
This will check username exist or not asynchronusly & also your ui will not be blocked.
Refere this link
http://www.semenoff.dk/en/Code-Corner/ASP.Net.AJAX/WebService-From-JavaScript.aspx

You can also use page method for this purpose
Refere this
http://www.dotnetcurry.com/ShowArticle.aspx?ID=109


如果您保存用户数据库中的详细信息

然后检查或编写一个查询,将文本框值与数据库进行比较..

如果存在,则向用户显示消息...



ex:从注册中选择用户名name =textbox1.Text

检查条件如

if(username == textbox1.text)

{

messagebox.show(alredy exists);

}
if you save the user details in database
then check or write a query that compare text box value into database..
if it exists then show the message to user...

ex: select username from registration where name="textbox1.Text"
check condition like
if(username==textbox1.text)
{
messagebox.show("alredy exists");
}


这篇关于查询在c#中搜索texbox的丢失焦点事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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