dynamic device specific script

Discussion in 'ASP .Net Mobile' started by ashelley@inlandkwpp.com, Sep 30, 2004.

  1. Guest

    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
    , Sep 30, 2004
    #1
    1. Advertising

  2. Guest

    On Thu, 30 Sep 2004 17:27:42 GMT, wrote:

    >
    >Anyone have any suggestions? Any insight is appreciated.
    >


    as a hack i created multiple devicespecific controls and toggle them
    visible as needed. This was a less than optimal system but it works.

    I would have liked the flexibility to dynamically generate the
    scripts.

    -Adam
    , Sep 30, 2004
    #2
    1. Advertising

  3. 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



    <> wrote in message
    news:...
    >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
    Conor O'Doherty, Oct 25, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeremy Deats'
    Replies:
    8
    Views:
    1,184
    DigiAl
    Jul 5, 2004
  2. nishadixit
    Replies:
    5
    Views:
    1,234
    Joe Discar
    Jun 1, 2005
  3. Replies:
    1
    Views:
    412
    santosh
    Nov 27, 2006
  4. Shannon

    Utilizing Device Specific RAM

    Shannon, Sep 13, 2007, in forum: VHDL
    Replies:
    9
    Views:
    593
    Mike Treseler
    Sep 13, 2007
  5. Matt
    Replies:
    0
    Views:
    458
Loading...

Share This Page