Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Mobile > Set focus on mobile page

Reply
Thread Tools

Set focus on mobile page

 
 
gmengerink@gmail.com
Guest
Posts: n/a
 
      10-30-2007
There was an article about setting the focus in a mobile page with
this code:
<mobileanel id="Panel1" runat="server">
<mobileeviceSpecific id="DeviceSpecific1" Runat="server">
<Choice Filter="isHTML32">
<contenttemplate>
<Script for='window' event='onload' language='jscript'>
window.Form1.TB_Location.focus();
</Script>
</contenttemplate>
</Choice>
</mobileeviceSpecific>
</mobileanel>

This works on my page, but I want to make a page with more than one
textbox
for scanning purpose. Like order numer, article, etc.
I tried to use RegisterStartupScript, with this code:

private void SetFocus(Control FocusControl)
{
string ClientID = FocusControl.ClientID;
System.Text.StringBuilder ScrFocus = new System.Text.StringBuilder();
ScrFocus.Append("<script for='window' event='onload'
language='jscript'>");
ScrFocus.Append("window.Form1.");
ScrFocus.Append(ClientID);
ScrFocus.Append(".focus();");
ScrFocus.Append("</script>");

this.RegisterStartupScript("SetFocus",ScrFocus.ToS tring());
}

So I can call after scanning the first barcode for textbox1
SetFocus(textbox2);
etc etc.
But the code isn't working.
Is there anyone who nows how and where in my code I can call this
script so I can set the focus of the
cursor in the next textbox after scanning?

With kind regards,

G. Mengerink

 
Reply With Quote
 
 
 
 
JD
Guest
Posts: n/a
 
      11-04-2007
What device are you using?

I know the Blackberry browser does not support focus() for example.


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> There was an article about setting the focus in a mobile page with
> this code:
> <mobileanel id="Panel1" runat="server">
> <mobileeviceSpecific id="DeviceSpecific1" Runat="server">
> <Choice Filter="isHTML32">
> <contenttemplate>
> <Script for='window' event='onload' language='jscript'>
> window.Form1.TB_Location.focus();
> </Script>
> </contenttemplate>
> </Choice>
> </mobileeviceSpecific>
> </mobileanel>
>
> This works on my page, but I want to make a page with more than one
> textbox
> for scanning purpose. Like order numer, article, etc.
> I tried to use RegisterStartupScript, with this code:
>
> private void SetFocus(Control FocusControl)
> {
> string ClientID = FocusControl.ClientID;
> System.Text.StringBuilder ScrFocus = new System.Text.StringBuilder();
> ScrFocus.Append("<script for='window' event='onload'
> language='jscript'>");
> ScrFocus.Append("window.Form1.");
> ScrFocus.Append(ClientID);
> ScrFocus.Append(".focus();");
> ScrFocus.Append("</script>");
>
> this.RegisterStartupScript("SetFocus",ScrFocus.ToS tring());
> }
>
> So I can call after scanning the first barcode for textbox1
> SetFocus(textbox2);
> etc etc.
> But the code isn't working.
> Is there anyone who nows how and where in my code I can call this
> script so I can set the focus of the
> cursor in the next textbox after scanning?
>
> With kind regards,
>
> G. Mengerink
>



 
Reply With Quote
 
 
 
 
gmengerink@gmail.com
Guest
Posts: n/a
 
      11-05-2007
Thanks for replying.

I'm using an HP iPaq 6915 with windows mobile 5.0

 
Reply With Quote
 
Steveo
Guest
Posts: n/a
 
      11-12-2007
Hi,
How have you coded your "isHTML32" DeviceFilter in your Web.config?

"(E-Mail Removed)" wrote:

> Thanks for replying.
>
> I'm using an HP iPaq 6915 with windows mobile 5.0
>
>

 
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