asp .net mobile + javascript



Hi everyone!
i'm developing a small web application for a Pocket PC Symbol (Windows
Mobile 5.0).
This terminal has got a barcode scanner.
The application mainly works in this way: A barcode is read with the
scanner and written in a textbox. If it isn't the expected barcode,
any beep (i have a .wav file) sounds.

I have two problems and i think javascript is the solution:
- To put the focus on the texbox when on the load of the page.
- To make the beep sounds in the terminal.

I have had a look similar problems in many forums and the given
solutions either they doesn't work for me or i'm applying them in a
bad way.

I have found an example of how to use javascript with asp .net mobile,
it was aout a textox and a label that works as a character counter,
when a character was written in the textbox, the label was updated. I
copied the example and it works in my portatil but not in the
terminal, only the textbox appears in the web page. The example is the
following one:

Test_Javascript_CSharp.aspx
<%@ Register TagPrefix="mobile"
Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile"
%>
<html xmlns="http://www.w3.org/1999/xhtml";>
<body>
<mobile:Form ID="Form1" Runat="server">
<mobile:DeviceSpecific ID="DeviceSpecific3" Runat="server">
<Choice Filter="supportsJavaScript" Xmlns="http://
schemas.microsoft.com/mobile/html32template">
<ScriptTemplate>
<script type="text/javascript">
<!--
function ShowTypedText(txt1, l1) {
document.getElementById(l1).innerHTML =
document.getElementById(txt1).value.length;
}
//-->
</script>
</ScriptTemplate>
</Choice>
</mobile:DeviceSpecific>
<mobile:Panel ID="Panel1" Runat="server">
<mobile:DeviceSpecific ID="DeviceSpecific1"
Runat="server">
<Choice Xmlns="http://schemas.microsoft.com/mobile/
html32template">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" />
</br>
<asp:TextBox ID="TextBox1" runat="server"></
asp:TextBox>
</ContentTemplate>
</Choice>
</mobile:DeviceSpecific>
</mobile:Panel>
</mobile:Form>
</body>
</html>


Test_Javascript_CSharp.aspx.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Mobile;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.MobileControls;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

public partial class wap_Test_JavaScript2_CSharp :
System.Web.UI.MobileControls.MobilePage
{
protected void Page_Load(object sender, EventArgs e)
{
System.Web.UI.WebControls.TextBox tBox1 =
Panel1.Content.FindControl("TextBox1") as
System.Web.UI.WebControls.TextBox;
System.Web.UI.WebControls.Label l1 =
Panel1.Content.FindControl("Label1") as
System.Web.UI.WebControls.Label;
tBox1.Attributes.Add("onkeyup", "javascript:ShowTypedText('" +
tBox1.ClientID + "','" + l1.ClientID + "')");
}
}



Maybe this example is uncompleted to make it work in a pocket pc? How
can i apply it for my case?

I would thank any help!
Thank you!
.



Relevant Pages

  • Re: creating an import for Access 2000 from a PA 600 mobile device
    ... There are quite a few different types of barcode scanners out there. ... Another type is the mobile device like ... mobile unit and run it from there. ... remotely while they are moving around from coil to coil. ...
    (comp.databases.ms-access)
  • how to print document locally
    ... mobile application communicates with the server using web services. ... 1.The barcode printing is requested from mobile device. ... The server receives the request and generates the barcode. ...
    (microsoft.public.dotnet.distributed_apps)
  • Re: tickets by phone
    ... which passengers can then scan at the station ticket barrier. ... I considered that when I first read it - however, even if a barcode is ... barcode reader trying to scan a barcode displayed on a mobile phone ...
    (uk.railway)
  • Re: An idea to help avoid pricing errors in supermarkets
    ... have noticed the scales provided. ... that invite customers to print off and apply barcode labels to their ... If, like the scales in the veg & fruit, there was a barcode scanner in ... database of such barcode scanners updated? ...
    (uk.legal)
  • Re: Stopping Default Sound from Playing
    ... The Return character is sent by the barcode scanner to indicate ... turning the beep off. ...
    (microsoft.public.dotnet.general)