Another approach, although it is still javascript, is to include code in your code behind. Just put the following inside of your Page_Load method:
Dim script As String = "<script language=javascript> document.forms[0]." & _
txtMyControl.ClientID.ToString() + ".focus();</script>"
RegisterStartupScript("focus", script)
Just substitute "txtMyControl" with the name of the Control you want to set focus to.
>Hi Douglas,
>
>Using "elements[1]" instead of "button1" did the trick.
>
>< body onload="document.forms[0].elements[0].focus();" > - [] not ().
>
>Im going to play around with a VB.Net solution, such as CONTROL.FOCUS(), in the page load event of my form, since Im not real excited about adding another language (javascript) to my bag of tricks unless I have to.
>
>For now though, Im doing it your way...
>
>Many thanks for your help!
>
>Todd
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi