Asp.net custom onfocus event for textbox
There is nothing built in there, because focusing the textbox does not cause the page to be submitted. You can always bind the event to focus on the client side and then send some kind of AJAX request to the server, but I'm curious to know what exactly you are trying to achieve here.
a source to share
I would highly recommend using client side validation for this. You can use ASP.NET validators for this. One of the properties on the validator is to set focus on an error. This should be more than enough for what you are trying to do, and also limits the number of server side calls.
If you're really feeling creative, you might want to look at some of the other validation options and the AJAX Control Panel extension. There are some pretty fun validator validation tools out there. Another option would be to consider using some jQuery validation.
You should still check on the server, but what you are describing seems to be perfect for client validation.
a source to share
Ok, I got a webform and when validating a submit, if there are errors on the page, those errors are saved in the state and a warning sign is displayed.
Now when the user is viewing the errors, I wanted the popup to appear next to the textbox they are currently fixing.
For this to happen, I wanted to have an event attached to a handle of type onfocus.