Saturday, February 10, 2007

Default Focus in VS.net 2005

If you are using vs.net 2005 than the easiest way to focus the element is by using defaultbutton and defaultfocus property....

<form id="form1" runat="server" defaultbutton="btnSubmit" defaultfocus="txtName">
And if you are using master file than just add this statement in page_load event.

this.Form.DefaultButton = this.btnSubmit.UniqueID;
this.Form.DefaultFocus = this.txtName;

No comments:

Most Recent Post

Community Updates

Subscribe Blog via Email

Enter your email address:



Disclaimers:We have tried hard to provide accurate information, as a user, you agree that you bear sole responsibility for your own decisions to use any programs, documents, source code, tips, articles or any other information provided on this Blog.
Page copy protected against web site content infringement by Copyscape