Click here to Skip to main content
15,915,093 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i want each entry in a textbox should check with table.is there any possible to use any tool in asp.net or ajax.
i was tried in code ,but its take some time to checkout.

i want to set the validation for this textbox.

Thanks,
Posted
Updated 20-Oct-13 18:57pm
v3
Comments
JoCodes 21-Oct-13 1:14am    
Can you post the code what you have tried so far ???

i did that,its take some time to load ...
 
Share this answer
 
Comments
JoCodes 21-Oct-13 2:03am    
have you checked the link which uses ajax to do the same?
King Fisher 21-Oct-13 2:55am    
protected void txtpassport_TextChanged(object sender, EventArgs e)
{
try
{

if (txtpassport.Text != "")
{
obj.passport = txtpassport.Text;
obj.Value = 44;
dr = obj.CheckDummy();
dr.Read();
if (dr.HasRows)
{
dr.Close();
msg.ShowAlertMessage("Passport Number Already Exists");
txtpassport.Text = "";
}
else
{
dr.Close();
}
}
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}
}

with autopostback =true:

query is "Select *from tbl_table name where passport_no=@passport"


Like this i want to check Driving Licence Number,PAN card ,.. so its take long time
You can handle it inside the TextChanged event of the Textbox . Something like the below code .
<asp:TextBox ID="TextBox1" runat="server" OnTextChanged="TextBox1_TextChanged"></asp:TextBox>


Code Behind :

C#
protected void TextBox1_TextChanged(object sender, EventArgs e)
        {
           //Do your input checking with  a DB Call
        }


You can check this article as a reference if you want to check the same in Clientside/Ajax

http://www.aspsnippets.com/Articles/Check-Username-Availability-in-ASP.Net-using-AJAX-PageMethods.aspx[^]


Hope this helps...
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900