I would like a textbox to have focus at the start of the
application.
How would I code this? Im still trying to figure this one
out.
Im developing an asp.net mobile web application, c#
vs 2003.
The code below is what I have used. It does not seem to setfocus to the asp.net textbox.
I have also tried your code with c# language modifications. This also does not set focus to the textbox. Please let me know if I have a coding issue.
StringBuilder strBuilder = new StringBuilder();
strBuilder.Append("<script language = 'javascript'>");
strBuilder.Append("document.forms.MobileWebForm1.txtBarCodeReader.focus();");
strBuilder.Append("document.forms.MobileWebForm1.txtBarCodeReader.select();");
strBuilder.Append("</script>");
RegisterStartupScript("Focus",strBuilder.ToString());
Thanks
Alvin