Mobile forms an Javascript

W

Walter

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top