Monday, January 3, 2011

Set focus an asp.net control using Page setfocus method

Most of the time, i usually have a javascript function to set focus a control during pageload. The control.focus() most of the time does not work. But in an asp.net Page control, there is a handy method to focus.
Code:
Page.Setfocus(Control.ClientID); 
where Control could be a textbox or button.

0 comments:

Post a Comment