Control focus with Postback

While working with ASP.Net update panel control, the Tab focus will make some problems. Here is a simple solution for that, you can use the Script Manager class to set focus to a specific control.

ScriptManager1.SetFocus(Control);	//You can either use the control or the clientID of the control.

And if you are using Master Pages and placing the script manager in the master page, you can use the following code to get the script manager class.

ScriptManager ScriptManager1 = ScriptManager.GetCurrent(this.Page)	//Getting the script manager class of the current page.
This entry was posted in .Net, .Net 3.0 / 3.5, ASP.Net, Javascript. Bookmark the permalink.

0 Responses to Control focus with Postback

  1. kunal kumar says:

    thanks a lot
    it wors the same i wanted

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>