473,569 Members | 2,793 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.setfoc us' 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 1954
CoTConnie wrote:
I'm trying to setfocus on a textbox after an error conditions, but the
compile insists that 'textbox.setfoc us' 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
RegisterClientS criptBlock?

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.setfoc us' 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
RegisterClientS criptBlock?

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.setfoc us' 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
RegisterClien tScriptBlock?

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.setfoc us' 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
RegisterClien tScriptBlock?

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.setfoc us' 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
RegisterCli entScriptBlock?

Dec 6 '05 #6
John,

Are you sure registerclients tript 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
registerclients cript 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="JavaS cript">
document.all("f ieldid").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.publi c.dotnet.framew ork.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
1687
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 ActiveState stuff, which tried to compile IL and apparently didn't succeed. Two motives for the question: 1) whether to use it for my C++ / C# /...
0
1133
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 someone have a solution to that ? Thanks David
0
2119
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 and setting WebSite2 as the host header name. 2. I can browse to this web site using IE http://WebSite2 buy placing a an entry in my host file,...
0
1278
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 anoying textbox with some long code showing up in the page. I have tried the following.... 1) Post the innerHTML of a table or form using...
1
16221
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 System.Drawing.Image.Save" error. public void addAnnotationStampOnImage() { string strStamp = Path.GetFileNameWithoutExtension(_ImageFileName); Size dSize;...
0
2225
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 - System.InvalidCastException: Unable to cast COM object of type 'mshtml.HTMLBodyClass' to class type ''. COM components that enter the CLR and do not support...
6
5816
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
2175
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
1437
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. This control have one Save Button. And this control haivng one Raise Event for this save button. I am using this UC in master page.
1
2016
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
8119
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7668
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5218
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.