Click here to Skip to main content
15,906,341 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How i can fire text box focus out event in asp.net web application at server side
Posted
Updated 7-Jul-11 1:05am
v2

You want to fire or catch event?
By the way it is onblur, if it helps.

Google[^] to know how to catch it on serverside.
http://stackoverflow.com/questions/3863927/lost-focus-method-for-asp-net-textbox[^]
 
Share this answer
 
v2
Comments
Marikani P 7-Jul-11 7:11am    
i want catch event in server side not in client side
Prerak Patel 7-Jul-11 7:16am    
Check the updated link.
Sergey Alexandrovich Kryukov 7-Jul-11 15:00pm    
Why?
--SA
Sergey Alexandrovich Kryukov 7-Jul-11 15:01pm    
My 5. I would recommend doing it on the client side only as the latency would kill performance -- this event is way too frequent to post back and wait for response.
--SA
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 7-Jul-11 15:03pm    
OnBlur is right thing to handle. OP wants to handle on server side but -- see my comment to the answer by Prerak. My 5 for this one.
--SA
Hi,
We can do the same by using javascript,please try it using javascript.

we can change control from the client side to server side using __doPostBack function.

we can pass argument to the server side using dopostback function.
it causes postback in the server side ,accept that argument in server side and and do ur binding according with condition

in javascipt function
__doPostBack('onfocusout');


in pageload

string strText = System.Web.HttpContext.Current.Request.Params.Get("__EVENTTARGET");
if (strText.Equals("onfocusout"))
{
do your code here..........binding......................
}


regards ,
shefeek
 
Share this answer
 
v4
Comments
Marikani P 7-Jul-11 7:20am    
I'm also did it but i want to bind data from db on focusout event so i need at server side
shefeekcm 7-Jul-11 7:29am    
do you need sample code?
shefeekcm 7-Jul-11 7:33am    
please try the code and reply.

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