Hi asadikhan,
you can use the following sample script to do this, Replace the TextBox1
with the name of the control to which you want to set the focus to
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
StringBuilder myJavaScript = new StringBuilder();
myJavaScript.Append("<script language='Javascript'> function
setfocus(){");
myJavaScript.Append("document.getElementById(\"" +
TextBox1.ClientID + "\").focus();");
myJavaScript.Append("} setfocus();</script>");
this.RegisterStartupScript("SetFocusScript",
myJavaScript.ToString());
}
HTH
Regards
Ashish M Bhonkiya
<as*******@hotmail.com> wrote in message
news:fd*************************@posting.google.co m...
I really really really need to put the cursor in a text box at onload.
I can't figure out how to do this in ASP.NET. Anyone? In ASP.NET,
javascript, anything ...