Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Mobile > setfocus on mobile textbox for barcode scanning

Reply
Thread Tools

setfocus on mobile textbox for barcode scanning

 
 
Robin Prosch via .NET 247
Guest
Posts: n/a
 
      07-03-2004
I am trying to make asimple asp.net mobile Webform, that has onetextbox, in wich a barcode scanner enters a barcode and a"return"

1.) How do i get the focus on the textbox on page load ? ( Pleasenote that MOBILE textbox control has no setfocus)

Some things that did not work so far on the mobile Webform :
################################################## ##################
Private Sub SetFocus(ByVal FocusControl As Control)
Dim Script As New System.Text.StringBuilder
Dim ClientID As String = FocusControl.ClientID

With Script
.Append("<script language='javascript'>")
.Append("document.getElementById('")
.Append(ClientID)
.Append("').focus();")
.Append("</script>")
End With
RegisterStaTextBox id="TextBox1"runat="server"></mobile:TextBox>
</mobile:Form>
</body>

But this one get me the following error while executing (sorryfor german, but i hope you, dear reader, get the point):

[ArgumentException: Auf der Seite "isHTML32", die System.Booleanzur?ckgibt und System.Web.Mobile.MobileCapabilities undSystem.String als Argumente akzeptiert, ist weder eineGer?tefunktion mit dem Namen "isHTML32" noch eine ?ffentliche,nicht statische Methode vorhanden.]
What do I need to set / do additionally ? Anything aboutdevicefilters in web.config ?

Any hint / help would be highly appreciated.

best regards,

Robin rtupScript("setFocus", Script.ToString())
End Sub
'This works perfect on normal Web Forms !
'################################################# ###########


Another attempt taken from the internet is the followoing :

<%@ Register TagPrefix="mobile"Namespace="System.Web.UI.MobileC ontrols"Assembly="System.Web.Mobile" %>
<%@ Page Language="vb" AutoEventWireup="false"Codebehind="MWnyatecSCANInp ut.aspx.vb"Inherits="NyatecSCANInput.MWnyatecSCANI nput" %>

<HEAD>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_targetSchema"content="http://schemas.microsoft.com/Mobile/Page">
</HEAD>

<body Xmlns:mobile="http://schemas.microsoft.com/Mobile/WebForm">
<mobile:Form id="nyatec" runat="server">
<mobileeviceSpecific id="DeviceSpecific1" runat="server">
<Choice Filter="isHTML32"Xmlns="http://schemas.microsoft.com/mobile/html32template">
<ScriptTemplate>
<SCRIPT language="javascript" for="window" EVENT="onload()">
document.Form1.TextBox1.focus();
</SCRIPT>
</ScriptTemplate>
</Choice>
</mobileeviceSpecific>
<mobile:










--------------------------------
From: Robin Prosch

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>4C6NTa3m/kachTPcSfE5VA==</Id>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
iPhone4,iPhone3,Ipad,Apple Mobile,Blackberry Mobile,HTC Mobile,LGMobile,Motorola Mobile,Nokia Mobile,Samsung Mobile chen selina C++ 0 07-13-2010 08:53 AM



Advertisments