unsonmebest
New Member
Within the page_load event I put <BR>Textbox1.setFocus() and it says that setfocus is not a member in the textbox control. I have found several samples saying this is how to set the textbox control. Any ideas why this isn't working. Do I need to import anything?Try this. This will set the focus to any control by inserting HTML code into the load event of the page on a one time only basis. So use it when you are finished processing or on form load.<BR><BR>Dim strScript As String ' now set the focus to the control<BR>strScript = "<Script language=vbscript> document.Form1.TextBox1.focus() </Script>"<BR>RegisterStartupScript("focus", strScript)<BR><BR>Enjoy<BR><BR>JSHAW<BR><BR>You can't because focus is still a client side control. <BR>But you can read this and actually see an example of a server side script that will do what you are looking for<BR>http://www.aspalliance.com/shark/articles/NewbieFAQs/FAQDoc.aspxThis is a great article on how to create a control that you can use to set focus.<BR><BR>http://www.devx.com/dotnet/articles/rj121801/rj121801-1.asp