How to Set Focus on Controls in Asp.net web forms at page level

26 10 2007

In Asp.net 1.1, focus of asp.net controls in web forms by using java script write code but asp.net 2.0 you can set focus on controls at control level and page level.

Control Level means Textbox have one property SetFocus by using this property you can set focus

of cusor in textbox

Page level:-This is another alternative to set the focus on controls

Syntax:-

<form id=”formname” runat=”server” defaultfocus=”controlname”>

</form>

Example:-

<form id=”form1″ runat=”server” defaultfocus=”txtEno”>

<asp:TextBox runat=”server” id=”txtEno”></asp:TextBox>

</form>


Actions

Information

2 responses

14 12 2008
caring christmas live tree

Comprehensive Work, I liked It, Thanks

15 12 2008
country of turkey

You Have To Check This OutGreat Job, by far Liked It The Most

Leave a comment