473,395 Members | 1,919 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.

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.InvalidOperationException: 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_Activate(object sender, EventArgs e)
Line 20: {
Line 21: TextBox1.Focus();
Line 22:
Line 23: }
Source File:
E:\DevelopmentWebsite\IntranetDev\Portal\Testing\M ultiViewTest.aspx.cs
Line: 21

Stack Trace:

[InvalidOperationException: A form tag with runat=server must exist on the
Page to use SetFocus() or the Focus property.]
System.Web.UI.Page.SetFocus(Control control) +2021658
System.Web.UI.Control.Focus() +20
Testing_MultiViewTest.WizardStep1_Activate(Object sender, EventArgs e) in
E:\DevelopmentWebsite\IntranetDev\Portal\Testing\M ultiViewTest.aspx.cs:21
System.Web.UI.WebControls.View.OnActivate(EventArg s e) +105
System.Web.UI.WebControls.MultiView.set_ActiveView Index(Int32 value) +395
System.Web.UI.WebControls.MultiView.OnInit(EventAr gs e) +46
System.Web.UI.Control.InitRecursive(Control namingContainer) +321
System.Web.UI.Control.AddedControl(Control control, Int32 index) +2065279
System.Web.UI.ControlCollection.Add(Control child) +146
System.Web.UI.WebControls.Wizard.CreateControlHier archy() +2992
System.Web.UI.WebControls.Wizard.CreateChildContro ls() +126
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.WebControls.Wizard.OnInit(EventArgs e) +100
System.Web.UI.Control.InitRecursive(Control namingContainer) +321
System.Web.UI.Control.InitRecursive(Control namingContainer) +198
System.Web.UI.Control.InitRecursive(Control namingContainer) +198
System.Web.UI.Control.InitRecursive(Control namingContainer) +198
System.Web.UI.Control.InitRecursive(Control namingContainer) +198
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +692
Apr 12 '06 #1
2 1232
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*****@discussions.microsoft.com> a écrit dans le message de
news: 37**********************************@microsoft.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.InvalidOperationException: 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_Activate(object sender, EventArgs e)
Line 20: {
Line 21: TextBox1.Focus();
Line 22:
Line 23: }
Source File:
E:\DevelopmentWebsite\IntranetDev\Portal\Testing\M ultiViewTest.aspx.cs
Line: 21

Stack Trace:

[InvalidOperationException: A form tag with runat=server must exist on the
Page to use SetFocus() or the Focus property.]
System.Web.UI.Page.SetFocus(Control control) +2021658
System.Web.UI.Control.Focus() +20
Testing_MultiViewTest.WizardStep1_Activate(Object sender, EventArgs e) in
E:\DevelopmentWebsite\IntranetDev\Portal\Testing\M ultiViewTest.aspx.cs:21
System.Web.UI.WebControls.View.OnActivate(EventArg s e) +105
System.Web.UI.WebControls.MultiView.set_ActiveView Index(Int32 value) +395
System.Web.UI.WebControls.MultiView.OnInit(EventAr gs e) +46
System.Web.UI.Control.InitRecursive(Control namingContainer) +321
System.Web.UI.Control.AddedControl(Control control, Int32 index) +2065279
System.Web.UI.ControlCollection.Add(Control child) +146
System.Web.UI.WebControls.Wizard.CreateControlHier archy() +2992
System.Web.UI.WebControls.Wizard.CreateChildContro ls() +126
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.WebControls.Wizard.OnInit(EventArgs e) +100
System.Web.UI.Control.InitRecursive(Control namingContainer) +321
System.Web.UI.Control.InitRecursive(Control namingContainer) +198
System.Web.UI.Control.InitRecursive(Control namingContainer) +198
System.Web.UI.Control.InitRecursive(Control namingContainer) +198
System.Web.UI.Control.InitRecursive(Control namingContainer) +198
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +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*****@discussions.microsoft.com> a écrit dans le message de
news: 37**********************************@microsoft.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.InvalidOperationException: 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_Activate(object sender, EventArgs e)
Line 20: {
Line 21: TextBox1.Focus();
Line 22:
Line 23: }
Source File:
E:\DevelopmentWebsite\IntranetDev\Portal\Testing\M ultiViewTest.aspx.cs
Line: 21

Stack Trace:

[InvalidOperationException: A form tag with runat=server must exist on the
Page to use SetFocus() or the Focus property.]
System.Web.UI.Page.SetFocus(Control control) +2021658
System.Web.UI.Control.Focus() +20
Testing_MultiViewTest.WizardStep1_Activate(Object sender, EventArgs e) in
E:\DevelopmentWebsite\IntranetDev\Portal\Testing\M ultiViewTest.aspx.cs:21
System.Web.UI.WebControls.View.OnActivate(EventArg s e) +105
System.Web.UI.WebControls.MultiView.set_ActiveView Index(Int32 value) +395
System.Web.UI.WebControls.MultiView.OnInit(EventAr gs e) +46
System.Web.UI.Control.InitRecursive(Control namingContainer) +321
System.Web.UI.Control.AddedControl(Control control, Int32 index) +2065279
System.Web.UI.ControlCollection.Add(Control child) +146
System.Web.UI.WebControls.Wizard.CreateControlHier archy() +2992
System.Web.UI.WebControls.Wizard.CreateChildContro ls() +126
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.WebControls.Wizard.OnInit(EventArgs e) +100
System.Web.UI.Control.InitRecursive(Control namingContainer) +321
System.Web.UI.Control.InitRecursive(Control namingContainer) +198
System.Web.UI.Control.InitRecursive(Control namingContainer) +198
System.Web.UI.Control.InitRecursive(Control namingContainer) +198
System.Web.UI.Control.InitRecursive(Control namingContainer) +198
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +692


Apr 12 '06 #3

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

Similar topics

4
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...
36
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
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...
7
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). ...
2
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...
1
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...
25
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....
4
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...
7
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...
14
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...
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: 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
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...
0
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...
0
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,...

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.