Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i am working with asp.net
i have many control in a webform
i have a button
and i want execute a function or a procedure when my button get focus
example :when button get focus or tabindex run button_click()
in asp.net i dont have getfocus event or setfocus event.
how i do it
Posted

You can do this using javascript, something like this


JavaScript
document.getElementById('txt').focus();
document.getElementById('txt').value= "RoseIndia";
 
Share this answer
 
Comments
sadegh_rusta 6-Jul-12 8:22am    
i want solution with C#
For Button I don't think there is Focus event. Only Click event is present.
You can try with Click event, right?
 
Share this answer
 
Comments
sadegh_rusta 6-Jul-12 8:52am    
no i have a webform (Register new User) in my site
in i have one textbox(Username) and a Button On the Right side
i want do wxample yahoo.com
i want run button_click when textbox_username Lost focus and button get focus
for scan username
 
Share this answer
 

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