Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Textbox1.Focus() errors out in MOBILE asp page

Status
Not open for further replies.

chromarog

MIS
Mar 15, 2001
61
US
I'm trying to create a scanning application. The last hurdle I have is to get the form to load with the focus in 1 textbox.

Me.ActiveForm = Me.Form2
TextBox1.Focus()

I get "A form tag with runat=server must exist on the Page to use SetFocus() or the Focus property. "

I have 17 (SEVENTEEN) "Runat=Server"'s in my asp page.

Please tell me what I'm missing.

Thanks,
Rog...
 
what is ActiveForm = From2?
if TextBox1 does not have a runat="server" attribute then the codebehind wouldn't pick up the control to begin with. looks like there is an underlying problem that VS is not detecting. Does the page work without TextBox1.Focus()?

if so they use simple js to set the focus instead of having the code behind render it.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
I haven't found an answer for this either. I am currently working on a mobile application. .Focus() and SetFocus() both do not work in a mobile application. If you find out a descent explanation why, I'd like to know.
 
The activeform is at a click event, it sets the form2 active and then I'm trying to set the focus on a text box so the scanner will scan a barcode and input the data right in the textbox.

If the setfocus function is not there then the page works as it should, except for the focus.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top