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