.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

ASP.Net TextBox Leave event..

Posted By: susant     Posted Date: October 07, 2008    Points:2   Category :ASP.Net
i want to fire textbox leave event in asp2.0

how can i?

please give me a solution as soon as possible.

thanks in advance.

Responses
Author: Rahul             
Posted Date: October 07, 2008     Points: 5   

Hi,
you can use javascript "onblur" event. to fire this event from code behind in page_load event.

txtBox1.Attributes.Add("onblur","javascript:YourJavascriptFunctionName();");

Author: susant             
Posted Date: October 07, 2008     Points: 5   

Hi Rahul, Actually my requirement is like that..

I have one form name reg.aspx...
In TextBox1 the user will enter the user name.. So i want to run one query like:

select user_id from <table> where user_id= textBox1.text;

so what will happen if the user is already exist in db then it will display user exist else.....

So for this i need to write one event for textbox leaave event.. as soon as the user will press tab key ya any moment he is leaving the textbox1 the textbox_leave event will fire..


Susantaown@gmail.com
+91-9916351611

Author: Rahul             
Posted Date: October 08, 2008     Points: 5   

Hi Susant,
You can use Ajax to check user name and you can use "onkeyup" event of TextBox. Check this article for code.

http://weblogs.asp.net/traviscollins/archive/2008/02/12/check-username-availability-with-asp-net-ajax.aspx



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend