473,721 Members | 2,216 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Possible bug?

I have posted this question 3 times now and no-one has even answered it, so
is it possibly a bug or am i missing something. In short it does not seem to
be possible to set the focus on control from within the Active event handler
of the WizardStep control. Full details below.

For testing purposes i have got a 2 step WizardControl. Eqach step contains
a text box, TextBox1 and TextBox2 respectively. If i put the following code
in the respective activate event handlers for the two steps,

TextBox1.Text ="foo";

and

TextBox2.Text = "bar";

Then in the first step the TextBox (TextBox1) contains the word foo and in
the second step the TextBox (TextBox2) contains the word bar. As you would
expect.

However if i replace the code with

TextBox1.Focus( );

and

TextBox2.Focus( );

Then i get the below error and i can't understand why. This is the
first time i have used Wizard controls and i'm just trying to work out how
they behave. What am i missing about Wizard controls that is causing this
behaviour. Also it does not matter whether the textboxes are within the
wizardstep or not, you cannot seem to set the focus to any control from
within the Active event handler of the WizardStep control. If you call the
focus method from the Page_load event handler then it works fine.

Anyone any idea what is causing this, i have called the focus method from
within other event handlers such as the OnDataBound event and the OnClick
event with no problem.
Error details:

A form tag with runat=server must exist on the Page to use SetFocus() or
the Focus property.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.InvalidO perationExcepti on: A form tag with
runat=server must exist on the Page to use SetFocus() or the Focus property.

Source Error:

Line 19: protected void WizardStep1_Act ivate(object sender, EventArgs e)
Line 20: {
Line 21: TextBox1.Focus( );
Line 22:
Line 23: }
Source File:
E:\DevelopmentW ebsite\Intranet Dev\Portal\Test ing\MultiViewTe st.aspx.cs
Line: 21

Stack Trace:

[InvalidOperatio nException: A form tag with runat=server must exist on the
Page to use SetFocus() or the Focus property.]
System.Web.UI.P age.SetFocus(Co ntrol control) +2021658
System.Web.UI.C ontrol.Focus() +20
Testing_MultiVi ewTest.WizardSt ep1_Activate(Ob ject sender, EventArgs e) in
E:\DevelopmentW ebsite\Intranet Dev\Portal\Test ing\MultiViewTe st.aspx.cs:21
System.Web.UI.W ebControls.View .OnActivate(Eve ntArgs e) +105
System.Web.UI.W ebControls.Mult iView.set_Activ eViewIndex(Int3 2 value) +395
System.Web.UI.W ebControls.Mult iView.OnInit(Ev entArgs e) +46
System.Web.UI.C ontrol.InitRecu rsive(Control namingContainer ) +321
System.Web.UI.C ontrol.AddedCon trol(Control control, Int32 index) +2065279
System.Web.UI.C ontrolCollectio n.Add(Control child) +146
System.Web.UI.W ebControls.Wiza rd.CreateContro lHierarchy() +2992
System.Web.UI.W ebControls.Wiza rd.CreateChildC ontrols() +126
System.Web.UI.C ontrol.EnsureCh ildControls() +87
System.Web.UI.W ebControls.Wiza rd.OnInit(Event Args e) +100
System.Web.UI.C ontrol.InitRecu rsive(Control namingContainer ) +321
System.Web.UI.C ontrol.InitRecu rsive(Control namingContainer ) +198
System.Web.UI.C ontrol.InitRecu rsive(Control namingContainer ) +198
System.Web.UI.C ontrol.InitRecu rsive(Control namingContainer ) +198
System.Web.UI.C ontrol.InitRecu rsive(Control namingContainer ) +198
System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +692
Apr 12 '06 #1
2 1245
I would code to see if I can find the form parent control. Could it be
because the whole hierarchy is not totally build yet at this time ?

--
Patrice

"clickon" <cl*****@discus sions.microsoft .com> a écrit dans le message de
news: 37************* *************** **...icrosof t.com...
I have posted this question 3 times now and no-one has even answered it, so
is it possibly a bug or am i missing something. In short it does not seem
to
be possible to set the focus on control from within the Active event
handler
of the WizardStep control. Full details below.

For testing purposes i have got a 2 step WizardControl. Eqach step
contains
a text box, TextBox1 and TextBox2 respectively. If i put the following
code
in the respective activate event handlers for the two steps,

TextBox1.Text ="foo";

and

TextBox2.Text = "bar";

Then in the first step the TextBox (TextBox1) contains the word foo and in
the second step the TextBox (TextBox2) contains the word bar. As you would
expect.

However if i replace the code with

TextBox1.Focus( );

and

TextBox2.Focus( );

Then i get the below error and i can't understand why. This is the
first time i have used Wizard controls and i'm just trying to work out how
they behave. What am i missing about Wizard controls that is causing this
behaviour. Also it does not matter whether the textboxes are within the
wizardstep or not, you cannot seem to set the focus to any control from
within the Active event handler of the WizardStep control. If you call
the
focus method from the Page_load event handler then it works fine.

Anyone any idea what is causing this, i have called the focus method from
within other event handlers such as the OnDataBound event and the OnClick
event with no problem.
Error details:

A form tag with runat=server must exist on the Page to use SetFocus() or
the Focus property.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about
the error and where it originated in the code.

Exception Details: System.InvalidO perationExcepti on: A form tag with
runat=server must exist on the Page to use SetFocus() or the Focus
property.

Source Error:

Line 19: protected void WizardStep1_Act ivate(object sender, EventArgs e)
Line 20: {
Line 21: TextBox1.Focus( );
Line 22:
Line 23: }
Source File:
E:\DevelopmentW ebsite\Intranet Dev\Portal\Test ing\MultiViewTe st.aspx.cs
Line: 21

Stack Trace:

[InvalidOperatio nException: A form tag with runat=server must exist on the
Page to use SetFocus() or the Focus property.]
System.Web.UI.P age.SetFocus(Co ntrol control) +2021658
System.Web.UI.C ontrol.Focus() +20
Testing_MultiVi ewTest.WizardSt ep1_Activate(Ob ject sender, EventArgs e) in
E:\DevelopmentW ebsite\Intranet Dev\Portal\Test ing\MultiViewTe st.aspx.cs:21
System.Web.UI.W ebControls.View .OnActivate(Eve ntArgs e) +105
System.Web.UI.W ebControls.Mult iView.set_Activ eViewIndex(Int3 2 value) +395
System.Web.UI.W ebControls.Mult iView.OnInit(Ev entArgs e) +46
System.Web.UI.C ontrol.InitRecu rsive(Control namingContainer ) +321
System.Web.UI.C ontrol.AddedCon trol(Control control, Int32 index) +2065279
System.Web.UI.C ontrolCollectio n.Add(Control child) +146
System.Web.UI.W ebControls.Wiza rd.CreateContro lHierarchy() +2992
System.Web.UI.W ebControls.Wiza rd.CreateChildC ontrols() +126
System.Web.UI.C ontrol.EnsureCh ildControls() +87
System.Web.UI.W ebControls.Wiza rd.OnInit(Event Args e) +100
System.Web.UI.C ontrol.InitRecu rsive(Control namingContainer ) +321
System.Web.UI.C ontrol.InitRecu rsive(Control namingContainer ) +198
System.Web.UI.C ontrol.InitRecu rsive(Control namingContainer ) +198
System.Web.UI.C ontrol.InitRecu rsive(Control namingContainer ) +198
System.Web.UI.C ontrol.InitRecu rsive(Control namingContainer ) +198
System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +692

Apr 12 '06 #2
I suspect it most be something like that, but i was hoping someone might know
at what point the active event for a WizardStep control. I have never had a
problem calling the focus method on a control from any other event.

Could you give me an example of "code to find the parent control" because i
am not sure what you mean by this. Calling focus on any textbox, wherever it
is within the page causes this error.

"Patrice" wrote:
I would code to see if I can find the form parent control. Could it be
because the whole hierarchy is not totally build yet at this time ?

--
Patrice

"clickon" <cl*****@discus sions.microsoft .com> a écrit dans le message de
news: 37************* *************** **...icrosof t.com...
I have posted this question 3 times now and no-one has even answered it, so
is it possibly a bug or am i missing something. In short it does not seem
to
be possible to set the focus on control from within the Active event
handler
of the WizardStep control. Full details below.

For testing purposes i have got a 2 step WizardControl. Eqach step
contains
a text box, TextBox1 and TextBox2 respectively. If i put the following
code
in the respective activate event handlers for the two steps,

TextBox1.Text ="foo";

and

TextBox2.Text = "bar";

Then in the first step the TextBox (TextBox1) contains the word foo and in
the second step the TextBox (TextBox2) contains the word bar. As you would
expect.

However if i replace the code with

TextBox1.Focus( );

and

TextBox2.Focus( );

Then i get the below error and i can't understand why. This is the
first time i have used Wizard controls and i'm just trying to work out how
they behave. What am i missing about Wizard controls that is causing this
behaviour. Also it does not matter whether the textboxes are within the
wizardstep or not, you cannot seem to set the focus to any control from
within the Active event handler of the WizardStep control. If you call
the
focus method from the Page_load event handler then it works fine.

Anyone any idea what is causing this, i have called the focus method from
within other event handlers such as the OnDataBound event and the OnClick
event with no problem.
Error details:

A form tag with runat=server must exist on the Page to use SetFocus() or
the Focus property.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about
the error and where it originated in the code.

Exception Details: System.InvalidO perationExcepti on: A form tag with
runat=server must exist on the Page to use SetFocus() or the Focus
property.

Source Error:

Line 19: protected void WizardStep1_Act ivate(object sender, EventArgs e)
Line 20: {
Line 21: TextBox1.Focus( );
Line 22:
Line 23: }
Source File:
E:\DevelopmentW ebsite\Intranet Dev\Portal\Test ing\MultiViewTe st.aspx.cs
Line: 21

Stack Trace:

[InvalidOperatio nException: A form tag with runat=server must exist on the
Page to use SetFocus() or the Focus property.]
System.Web.UI.P age.SetFocus(Co ntrol control) +2021658
System.Web.UI.C ontrol.Focus() +20
Testing_MultiVi ewTest.WizardSt ep1_Activate(Ob ject sender, EventArgs e) in
E:\DevelopmentW ebsite\Intranet Dev\Portal\Test ing\MultiViewTe st.aspx.cs:21
System.Web.UI.W ebControls.View .OnActivate(Eve ntArgs e) +105
System.Web.UI.W ebControls.Mult iView.set_Activ eViewIndex(Int3 2 value) +395
System.Web.UI.W ebControls.Mult iView.OnInit(Ev entArgs e) +46
System.Web.UI.C ontrol.InitRecu rsive(Control namingContainer ) +321
System.Web.UI.C ontrol.AddedCon trol(Control control, Int32 index) +2065279
System.Web.UI.C ontrolCollectio n.Add(Control child) +146
System.Web.UI.W ebControls.Wiza rd.CreateContro lHierarchy() +2992
System.Web.UI.W ebControls.Wiza rd.CreateChildC ontrols() +126
System.Web.UI.C ontrol.EnsureCh ildControls() +87
System.Web.UI.W ebControls.Wiza rd.OnInit(Event Args e) +100
System.Web.UI.C ontrol.InitRecu rsive(Control namingContainer ) +321
System.Web.UI.C ontrol.InitRecu rsive(Control namingContainer ) +198
System.Web.UI.C ontrol.InitRecu rsive(Control namingContainer ) +198
System.Web.UI.C ontrol.InitRecu rsive(Control namingContainer ) +198
System.Web.UI.C ontrol.InitRecu rsive(Control namingContainer ) +198
System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +692


Apr 12 '06 #3

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

Similar topics

4
14472
by: Julia Briggs | last post by:
I am struggling to create a PHP function that would take a specified image (JPG, GIF or PNG) from a link, and resize it down to a thumbnail so it will always fit in a 200x250 space. I am hoping not to have it inserted or read from a database to do this function. Can it be done & someone please help me?
36
9467
by: rbt | last post by:
Say I have a list that has 3 letters in it: I want to print all the possible 4 digit combinations of those 3 letters: 4^3 = 64 aaaa
20
2507
by: CHIN | last post by:
Hi all.. here s my problem ( maybe some of you saw me on other groups, but i cant find the solution !! ) I have to upload a file to an external site, so, i made a .vbs file , that logins to the site, and then i have to select the file to upload.. i used sendkeys.. and i worked perfect.. BUT ... the computer must be locked for security ( obviusly ) reazons.. so..i think this probable solutions to unlock the computer and run the...
7
2348
by: Andrzej | last post by:
Is it possible to call a function which name is given by a string? Let assume that I created a program which call some functions for example void f1(void), void f2(void), void f3(void). After some time, I added new function void f4(void).
2
3817
by: Bhupesh Naik | last post by:
This is a query regarding my problem to make a spell and grammar check possible in text area of a web page. We have aspx pages which are used to construct letters. The browser based screens provide text area where the user can insert big chunks of text and submit it all to the server paragraph by paragraph. The requirement is to do a Spell Check AND Grammar Check in the text area. I did look at lot of possible third
1
6954
by: AAA | last post by:
hi, I'll explain fastly the program that i'm doing.. the computer asks me to enter the cardinal of a set X ( called "dimX" type integer)where X is a table of one dimension and then to fill it with numbers X; then the computer asks me how many subsets i have (nb_subset type (integer)) then,i have to enter for every sebset the card, and then to fill it, we'll have a two tables , one called cardY which contains nb_subset elements,and every...
25
2544
by: Piotr Nowak | last post by:
Hi, Say i have a server process which listens for some changes in database. When a change occurs i want to refresh my page in browser by notyfinig it. I do not want to refresh my page i.e. every 5 seconds, i just want to refresh it ONLY on server change just like desktop applications do. The problem is that refreshing evry n seconds has to much impact on my web server. The refresh action should be taken only when something
4
7683
by: RSH | last post by:
Okay my math skills aren't waht they used to be... With that being said what Im trying to do is create a matrix that given x number of columns, and y number of possible values i want to generate a two dimensional array of all possible combinations of values. A simple example: 2 - columns and 2 possible values would generate: 0 0
7
3359
by: Robert S. | last post by:
Searching some time now for documents on this but still did not find anything about it: Is it possible to replace the entry screen of MS Office Access 2007 - that one presenting that default 'templates' (with that big graphic buttons) - with some sort of own HTML-Page? I could imagine, that somehow it is possible to change this construction (hopefully not hardcoded in MS-Acc07), like it is possible to edit the 'Fluent Ribbon'? If so...
14
2002
by: bjorklund.emil | last post by:
Hello pythonistas. I'm a newbie to pretty much both programming and Python. I have a task that involves writing a test script for every possible combination of preference settings for a software I'm testing. I figured that this was something that a script could probably do pretty easily, given all the various possibilites. I started creating a dictionary of all the settings, where each key has a value that is a list of the possible...
0
8730
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9131
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9064
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8007
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6669
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4484
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4753
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3189
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
2
2576
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.