VJs Tip Of The Day
Reply
![]() |
|
From:
![]() VishalRJoshi
|
Whidbey Days - Page.SetFocus method in ASP.Net
Many have struggled to do simple thing like setting up focus in ASP.Net page... Well not anymore... There is a simple method called Page.SetFocus in System.Web.UI.Page class in Whidbey...
Look at the signature of the method
public void SetFocus(Control) where the parameter is the control on which the focus needs to be set...
There is also an overload for the method available which takes string
public void SetFocus(String) where the parameter is the clientID of the control to set focus on...
There are two exceptions which this method can throw; they are ArgumentNullException in case the clientID or control to set focus on are null... The method also throws an InvalidOperationException in case the method is called after PreRender event of the page as after that the setting the focus is not possible...
Simple and Nice way isn't it... :-)
PS: November 19th will be end of "Second Season" for "The Tip Of The Day" series... I will be off for a one month long vacation and will catch up with you guys again in new year 2005 when we will start the "Third Season"... Vishal Joshi Microsoft MVP .Net If You Think YOU CAN... You Can... http://VishalJoshi.Blogspot.com http://www.microsoft.com/india/mvp/indiamvp.aspx http://groups.msn.com/ChennaiNetUserGroup http://groups.msn.com/CNUG-DAM http://groups.msn.com/NetBloomingtonUserGroup
|
|
View other groups in this category.
![]() |
To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings.
Need help? If you've forgotten your password, please go to Passport Member Services.
For other questions or feedback, go to our Contact Us page.
If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list.
Remove my e-mail address from dotNET User Group Hyd.
|
|
- Re: VJs Tip Of The Day VishalRJoshi
-