Conor O'Doherty
10/25/2004 11:58:00 AM
Thank you
Thank you
Thank you
Thank you
Thank you Adam
I''m only 3 days into my very first web app, and my first requirement is to
set focus to my testbox.
Could I have possibly asked for a tougher task.
Finally, after trying all the samples & posts to set focus none of which
worked for me execpt yours.
I have seen other posts which used the same code but put the script in the
<FooterTemplate> tag which didn''t work for me even though others swear by
it, changing to <Contexttemplate> tag finally set the focus.
So Adam again Thank you :-)
Best Regards
Conor
<ashelley@inlandkwpp.com> wrote in message
news:j7gol0tr1deg1sqe0603upiuoatbaa05u7@4ax.com...
>I have this in my aspx page:
>
> --------------
> <mobile:DeviceSpecific id=DeviceSpecific1 Runat="server">
> <Choice Filter="isHTML32">
> <contenttemplate>
> <%# ((string)Session["clientScript"]) %>
> </contenttemplate>
> </Choice>
> </mobile:DeviceSpecific>
> --------------
>
> I have this in my code behind in formload:
>
> --------------
> Session["clientScript"] = "<Script for=\"window\" event=\"onload\"
> language=\"jscript\">window.Form1.txtJump.focus();</Script>";
> --------------
>
> But the client script is never added to the page. My goal is to be
> able to dynamically control which control gets focus when the page is
> redrawn. The following works:
>
> --------------
> <mobile:DeviceSpecific id="DeviceSpecific1" Runat="server">
> <Choice Filter="isHTML32">
> <contenttemplate>
> <Script for="window" event="onload"
> language="jscript">
> window.Form1.txtJump.focus();
> </Script>
> </contenttemplate>
> </Choice>
> </mobile:DeviceSpecific>
> --------------
>
> Anyone have any suggestions? Any insight is appreciated.
>
> -Adam