473,395 Members | 1,783 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Using SetFocus on a Web Page (VB.NET)

I'm trying to setfocus on a textbox after an error conditions, but the
compile insists that 'textbox.setfocus' isn't a valid command. I'm using all
the web page default setting, but am creating it in a FrontPage environment.
Does anyone know what I can do to make this command work?
Dec 5 '05 #1
6 1942
CoTConnie wrote:
I'm trying to setfocus on a textbox after an error conditions, but the
compile insists that 'textbox.setfocus' isn't a valid command. I'm using all
the web page default setting, but am creating it in a FrontPage environment.
Does anyone know what I can do to make this command work?


Are you using a javascript that you set at runtime using
RegisterClientScriptBlock?

Dec 5 '05 #2
No, I'm working exclusively in VB.NET. Would this make the command work?

thanks,

"John A. Bailo" wrote:
CoTConnie wrote:
I'm trying to setfocus on a textbox after an error conditions, but the
compile insists that 'textbox.setfocus' isn't a valid command. I'm using all
the web page default setting, but am creating it in a FrontPage environment.
Does anyone know what I can do to make this command work?


Are you using a javascript that you set at runtime using
RegisterClientScriptBlock?

Dec 5 '05 #3

Yes, this is the only way that I'm aware of.

I have a special class called PageUtil and it encapsulates the method so
that I can set focus to a control when an error arises.
CoTConnie wrote:
No, I'm working exclusively in VB.NET. Would this make the command work?

thanks,

"John A. Bailo" wrote:

CoTConnie wrote:
I'm trying to setfocus on a textbox after an error conditions, but the
compile insists that 'textbox.setfocus' isn't a valid command. I'm using all
the web page default setting, but am creating it in a FrontPage environment.
Does anyone know what I can do to make this command work?


Are you using a javascript that you set at runtime using
RegisterClientScriptBlock?

Dec 5 '05 #4
I don't know javascript. Would you please post your PageUtil class?

Thanks!

"John A. Bailo" wrote:

Yes, this is the only way that I'm aware of.

I have a special class called PageUtil and it encapsulates the method so
that I can set focus to a control when an error arises.
CoTConnie wrote:
No, I'm working exclusively in VB.NET. Would this make the command work?

thanks,

"John A. Bailo" wrote:

CoTConnie wrote:

I'm trying to setfocus on a textbox after an error conditions, but the
compile insists that 'textbox.setfocus' isn't a valid command. I'm using all
the web page default setting, but am creating it in a FrontPage environment.
Does anyone know what I can do to make this command work?

Are you using a javascript that you set at runtime using
RegisterClientScriptBlock?

Dec 5 '05 #5

It's explained and demoed here:

http://www.reflectionit.nl/InitialFocus.aspx
CoTConnie wrote:
I don't know javascript. Would you please post your PageUtil class?

Thanks!

"John A. Bailo" wrote:

Yes, this is the only way that I'm aware of.

I have a special class called PageUtil and it encapsulates the method so
that I can set focus to a control when an error arises.
CoTConnie wrote:
No, I'm working exclusively in VB.NET. Would this make the command work?

thanks,

"John A. Bailo" wrote:

CoTConnie wrote:
> I'm trying to setfocus on a textbox after an error conditions, but the
>compile insists that 'textbox.setfocus' isn't a valid command. I'm using all
>the web page default setting, but am creating it in a FrontPage environment.
>Does anyone know what I can do to make this command work?

Are you using a javascript that you set at runtime using
RegisterClientScriptBlock?

Dec 6 '05 #6
John,

Are you sure registerclientstript is working in this case?

I have to use it forever as javascript after the latest control in the html
because that latest get the focus after while the javascript in the
registerclientscript is than already done (however I ask this because I am
not completely sure because your definitive answer to this problem).

\\\
INPUT tabindex="1" id="fieldid" type="text" size="27">
//This beneath should than be the last rows in the html aspx file
<script language="JavaScript">
document.all("fieldid").focus();
</script>
</HTML>
///

Although I think that this is not the right solution for the OP, I assume
that it is better to use client side checking for this as long that there is
no database action required.

I thought that client side checking was described on this website.

http://samples.gotdotnet.com/quickstart/

While it is a typical problem often done in the newsgroup

microsoft.public.dotnet.framework.aspnet

I hope this helps a little bit?

Cor
Dec 6 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Brandon J. Van Every | last post by:
Is anyone using Python for .NET? I mean Brian's version at Zope, which simply accesses .NET in a one-way fashion from Python. http://www.zope.org/Members/Brian/PythonNet Not the experimental...
0
by: David Scemama | last post by:
Hi, I'm trying to fill a text control or a rich text control with the ASCII characters table, using code page 437. All the characters appears correctly except the semi graphic ones. Does...
0
by: Kieran Kelly | last post by:
Is it possible to create a new Web Application Project using Visual Studio.Net 2003 on Windows 2003 Server but no in the Default Web Site. 1. I have created a new Web Site in IIS called WebSite2...
0
by: Jim Mitchell | last post by:
I like to display my web site in a window so that users can use the "Send Page" function in IE to mail their output using their client side Outlook program. The problem is that I always get an...
1
by: Prasad More | last post by:
Hello, I am trying to write a text on Multi-page TIFF image using C# and .NET GDI+. I have written following code to do this. When I execute this code I get "Invalid Parameter User. at...
0
by: Atara | last post by:
Our application was build with VS 2003. I have tried to run it on a computer with .Net 2.0 (but without .Net 1.1 , as it should be used) and I got the following error - ...
6
by: bill | last post by:
Is there a way to retrieve values from the viewstate in the previouspage using cross page postback? Thanks! Bill
2
by: Kevin Humphreys | last post by:
Hi There, Is it possible to retrieve a client side control value using server VB.NET? Thanks, Kevin.
1
by: Rushi | last post by:
Hi All, I want to publish one Event from my Header User Control using Master pAge . And want to attach/detach this event from individual pages. Details: I have one User Control Header.ascx....
1
by: indirareddy | last post by:
Hai ... I Did One Project Without Title . How To Applied Title Name . Note :- I Have Using Master Page it is possible to write title in Default .aspx Example :-
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.