Login(Email) Password Forget Password? Account Settings
Home ASP.net System Info C# Books Java Script Visual C++(MFC) C/C++ Win API Java Contact Us
How to set foucs on a particular control on page load in VB.net , C#
To set a focus when web page is loaded you can use a BODY onload event and javascript client code. Let say you have a web form with ID="Form1" with some controls, including a textbox named TextBox1. To set a focus to TextBox1 when page is loaded you can use this javascript code:
 
<body onload="javascript:document.Form1.TextBox1.focus();">