[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.mobile

Running JavaScript in .NET Mobile WEB Form

Jeff

7/18/2002 11:02:00 PM

Below is an example of a script that works fine in a
VB.NET 'WEB Form'. I would like to find a simular
solution when using a VB.NET 'Mobile WEB Form'. I can not
seem to find a way to execute the same script function in
the Mobile WEB Form.


<script language='javascript'>
function SetFocusToFirst( )
{
document.getElementById('TextBox1').focus();
}
</script>

<body onload="SetFocusToFirst();">
.
.
.
.
.
.
</body>


Thanks,

Jeff
1 Answer

(Jason Jing)

7/22/2002 12:47:00 PM

0

Hello,

You need to put the client script inside a DeviceSpecific control, which
filter only HTML32 protocol, like following:

<mobile:Form id="Form1" runat="server">
<mobile:Panel id="Panel1" runat="server">
<mobile:DeviceSpecific id="DeviceSpecific1" runat="server">
<Choice Filter="isHTML32">
<contenttemplate>

<SCRIPT LANGUAGE="javascript">
<!--

Your Scripts...
//--></SCRIPT>
</contenttemplate>
</Choice>
</mobile:DeviceSpecific>
</mobile:Panel>
</mobile:Form>

Otherwise, your script will be removed from destination HTML source.

Another think you need to pay attention is that object model of Pocket IE
is a little different from desktop IE, you may need to change the script
for it to run correctly on Pocket IE.

Jason Jing
Microsoft Support
This posting is provided "AS IS", with no warranties, and confers no rights.


--------------------
| Content-Class: urn:content-classes:message
| From: "Jeff" <jdomkuski@pccweb.com>
| Sender: "Jeff" <jdomkuski@pccweb.com>
| Subject: Running JavaScript in .NET Mobile WEB Form
| Date: Thu, 18 Jul 2002 14:02:17 -0700
| Lines: 27
| Message-ID: <17a4401c22e9e$66188a70$a4e62ecf@tkmsftngxa06>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcIunmYYvPc4DrjUSk+pN6PZ7qedUg==
| Newsgroups: microsoft.public.dotnet.framework.aspnet.mobile
| Path: cpmsftngxa08
| Xref: cpmsftngxa08 microsoft.public.dotnet.framework.aspnet.mobile:4314
| NNTP-Posting-Host: TKMSFTNGXA06 10.201.232.165
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.mobile
|
| Below is an example of a script that works fine in a
| VB.NET 'WEB Form'. I would like to find a simular
| solution when using a VB.NET 'Mobile WEB Form'. I can not
| seem to find a way to execute the same script function in
| the Mobile WEB Form.
|
|
| <script language='javascript'>
| function SetFocusToFirst( )
| {
| document.getElementById('TextBox1').focus();
| }
| </script>
|
| <body onload="SetFocusToFirst();">
| .
| .
| .
| .
| .
| .
| </body>
|
|
| Thanks,
|
| Jeff
|