How to set focus to a textbox or button on form load in ASP.Net
By samjayander thiagarajan
How to set focus to a textbox or button on form load in ASP.Net without using javascript
Form Accessibility is important in improving the Usability of Web Pages.
On
Form load of a ASP.Net page, you may want to set the focus to a TextBox. In
that case you don't have to write a javascript and call it on form's onLoad event.
You
can simply use,
defaultfocus="<YourTextBoxID>" in the <form tag.
defaultbutton="<YourButtonID>" will set the specified Button as the default button.
eg:
<form
id="form1" runat="server" defaultfocus="TextBox1" defaultbutton="Button1">
</form >
How to set focus to a textbox or button on form load in ASP.Net (1234 Views)