如何使用asp.net验证检查Username的重复值? [英] How can I check duplicate value for Username using asp.net validations?

查看:83
本文介绍了如何使用asp.net验证检查Username的重复值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在文本框中输入数据时,应该从数据库中检查用户名是否存在。



如何使用ASP.NET验证进行编写。

While entering the data in textbox, it should check from database whether username exists or not.

How can I write with ASP.NET validations.

推荐答案

检查以下链接



使用JQuery检查ASP.Net中的用户名可用性


send the text box value to data base

and store the result in dataset

if(ds.rows.count>0)
{
//exist
}

else{
//not exist
}


I don't think Asp.Net validation can validate this type of occurrence.
if can then i don't know.
only i can suggest you that you can use ajax/jquery to validate similar to this.





使用ajax / jquery来调用代码隐藏方法进行验证检查并返回结果。



using ajax/jquery to call the code-behind method where you doing the validation check and returning the result.


这篇关于如何使用asp.net验证检查Username的重复值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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