Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Mobile > SetFocus on Load

Reply
Thread Tools

SetFocus on Load

 
 
Don Schilling
Guest
Posts: n/a
 
      11-10-2004
How can I set the focus on a textbox for Pocket PC mobile 2003?
On load I would like focus on text box so a bar code can be scanned without
any keypading.
I'm currently using C# in Visual Studio to create either a mobile or web
app.
I've tried javascript, looked at WML, but no luck.
As a side note, I cant seem to find a definitve answer to what javascript is
supported on Pocket PC.
Because of the device I'm using, a Symbol device using a an ARM Xscale
processor, I havent been able to find a third party browser.
Below is the java script I've tried. tbScan is the textbox I would like to
have focus.
I've spent a good chunk of time searching the web for an answer, but most of
the stuff out there is half baked.
TIA
Don

System.Text.StringBuilder sb = new System.Text.StringBuilder("");

sb.Append("<script language='JavaScript'>");

sb.Append("document.getElementById('" + this.tbScan.ClientID +
"').focus();<");

sb.Append("/");

sb.Append("script>");

if (!IsStartupScriptRegistered("Focus"))

{

this.RegisterStartupScript("Focus", sb.ToString());

}


 
Reply With Quote
 
 
 
 
William Main
Guest
Posts: n/a
 
      11-21-2004
It appears as though JavaScript is not exported to the web page from the aspx
age. I've even hard coded script into the aspx page and no luck, the HTML
page has no script in it. I suspect it has to do with the xml.dtd that is
referenced in the generated HTML page (also not ther is never a <HTML></HTML>
tag pair in the output either).

I've had to resort to using standard ASPX and not the MOBILE ASPX page type.

William main

"Don Schilling" wrote:

> How can I set the focus on a textbox for Pocket PC mobile 2003?
> On load I would like focus on text box so a bar code can be scanned without
> any keypading.
> I'm currently using C# in Visual Studio to create either a mobile or web
> app.
> I've tried javascript, looked at WML, but no luck.
> As a side note, I cant seem to find a definitve answer to what javascript is
> supported on Pocket PC.
> Because of the device I'm using, a Symbol device using a an ARM Xscale
> processor, I havent been able to find a third party browser.
> Below is the java script I've tried. tbScan is the textbox I would like to
> have focus.
> I've spent a good chunk of time searching the web for an answer, but most of
> the stuff out there is half baked.
> TIA
> Don
>
> System.Text.StringBuilder sb = new System.Text.StringBuilder("");
>
> sb.Append("<script language='JavaScript'>");
>
> sb.Append("document.getElementById('" + this.tbScan.ClientID +
> "').focus();<");
>
> sb.Append("/");
>
> sb.Append("script>");
>
> if (!IsStartupScriptRegistered("Focus"))
>
> {
>
> this.RegisterStartupScript("Focus", sb.ToString());
>
> }
>
>
>

 
Reply With Quote
 
 
 
 
Don Schilling
Guest
Posts: n/a
 
      11-22-2004
Using aspx rather than mobile wont help in this case. Java script is not
supported on the client, so it dosent matter what server method is used.



"William Main" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> It appears as though JavaScript is not exported to the web page from the

aspx
> age. I've even hard coded script into the aspx page and no luck, the HTML
> page has no script in it. I suspect it has to do with the xml.dtd that is
> referenced in the generated HTML page (also not ther is never a

<HTML></HTML>
> tag pair in the output either).
>
> I've had to resort to using standard ASPX and not the MOBILE ASPX page

type.
>
> William main
>
> "Don Schilling" wrote:
>
> > How can I set the focus on a textbox for Pocket PC mobile 2003?
> > On load I would like focus on text box so a bar code can be scanned

without
> > any keypading.
> > I'm currently using C# in Visual Studio to create either a mobile or web
> > app.
> > I've tried javascript, looked at WML, but no luck.
> > As a side note, I cant seem to find a definitve answer to what

javascript is
> > supported on Pocket PC.
> > Because of the device I'm using, a Symbol device using a an ARM Xscale
> > processor, I havent been able to find a third party browser.
> > Below is the java script I've tried. tbScan is the textbox I would like

to
> > have focus.
> > I've spent a good chunk of time searching the web for an answer, but

most of
> > the stuff out there is half baked.
> > TIA
> > Don
> >
> > System.Text.StringBuilder sb = new System.Text.StringBuilder("");
> >
> > sb.Append("<script language='JavaScript'>");
> >
> > sb.Append("document.getElementById('" + this.tbScan.ClientID +
> > "').focus();<");
> >
> > sb.Append("/");
> >
> > sb.Append("script>");
> >
> > if (!IsStartupScriptRegistered("Focus"))
> >
> > {
> >
> > this.RegisterStartupScript("Focus", sb.ToString());
> >
> > }
> >
> >
> >



 
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
asp.net setfocus after validation not working Mad Scientist Jr ASP .Net 4 07-15-2004 06:46 PM
Any opinions of SetFocus Corporation? MCSD 0 07-07-2004 11:04 PM
setfocus eh ! help jaffer the but ASP .Net 3 04-14-2004 01:28 PM
asp setfocus and performance jamess ASP .Net 1 10-30-2003 03:26 AM
SetFocus Jurjen de Groot ASP .Net 1 06-30-2003 04:29 PM



Advertisments