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:
Post a Comment