Mobile forms an Javascript

Discussion in 'ASP .Net Mobile' started by Walter, Jan 11, 2005.

  1. Walter

    Walter Guest

    I renew here an old question:
    I access a server side web application using I.E., and the Symbol Pocket PC
    PPT8800 (Microsoft Pocket PC V. 4.20.0 on ARM XScale).
    I need to set focus on one text control on the page load, and to refresh the
    client page every n seconds.
    I've found this is a very simple job to do with ASP.NET and web forms, using
    a client side Javascript code , registred by the RegisterStartupScript().
    This is the VB function I call in the Page_PreRender() event manager:

    Private Sub RegisterRefreshScript()
    If Not IsStartupScriptRegistered("autoPostBack") Then
    Dim refreshRate As Integer
    refreshRate = Convert.ToInt32(5000) ' do it
    all 5 seconds !
    Dim scriptBlock As StringBuilder = New StringBuilder()
    scriptBlock.Append("<script language=JavaScript>")
    scriptBlock.Append("function sessionlive_autoPostBack(){")
    scriptBlock.Append("__doPostBack('LinkButton1','');")
    scriptBlock.Append("}")

    scriptBlock.Append("window.setInterval('sessionlive_autoPostBack()',")
    scriptBlock.Append(refreshRate.ToString())
    scriptBlock.Append(");")
    scriptBlock.Append("document.getElementById('TextBox1').focus();")
    scriptBlock.Append("</script>")
    RegisterStartupScript("autoPostBack", scriptBlock.ToString())
    End If
    End Sub

    This works fine in ASP.NET and web forms, but it does not work at all using
    ASP.NET and Mobile Forms, where you can't find any javascript present in the
    final HTML page, also if you hard-code the javascript by hand!

    Please, can you give me any suggestion? maybe I have to use WML script?
    there is something wrong in my code?

    TIA
    Walter.
     
    Walter, Jan 11, 2005
    #1
    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. Zahoor
    Replies:
    1
    Views:
    846
    Darryl L. Pierce
    Nov 15, 2003
  2. chen selina
    Replies:
    0
    Views:
    1,392
    chen selina
    Jul 13, 2010
  3. Ryan Malone
    Replies:
    0
    Views:
    191
    Ryan Malone
    Aug 23, 2004
  4. Jeremy Chapman

    migrating aspx forms app to mobile forms

    Jeremy Chapman, Jun 15, 2006, in forum: ASP .Net Mobile
    Replies:
    1
    Views:
    757
    Christoph Richter [AT]
    Jun 18, 2006
  5. Eric
    Replies:
    2
    Views:
    644
Loading...

Share This Page