Hi All,
I'm trying to set the defaultbutton for a form to a button contained in a
step template for a wizard control. This is the code in PreRender:
switch (myWizard.Activ eStep.StepType) {
case WizardStepType. Start: this.Page.Form. DefaultButton =
"StartNextButto n"; break;
case WizardStepType. Finish: this.Page.Form. DefaultButton =
"FinishButt on"; break;
default: this.Page.Form. DefaultButton = "StepNextButton "; break;
}
I get this error:
The DefaultButton of 'form1' must be the ID of a control of type
IButtonControl
The buttons are clearly just buttons defined in the Template section of the
wizard.
Why can't it see the buttons defined in the templates?
Thanks,
John Mott jo********@hotm ail.com 3 7448
Hi,
John Mott wrote:
I'm trying to set the defaultbutton for a form to a button contained in a
step template for a wizard control. This is the code in PreRender:
[...]
I get this error:
The DefaultButton of 'form1' must be the ID of a control of type
IButtonControl
The buttons are clearly just buttons defined in the Template section of the
wizard.
Why can't it see the buttons defined in the templates?
I've seen that issue with a login-control. The simple remedy was to create
a dummy-button (visible, but width and height = 0) whose .Click-event
called the appropriate button within the login-control. You should actually
put your wizard-control into a panel and register the dummy-button as the
default button for that panel, this way you can have default-buttons for
different areas of your form.
Cheers,
Olaf
--
My .02: www.Resources.IntuiDev.com
I had the same problems with the Wizard Control. After reading 9,000
blog posts I did this for the first button on the wizard.
Page.Form.Defau ltButton =
Wizard1.FindCon trol("StartNavi gationTemplateC ontainerID$Star tNextButton").U niqueID;
For the other pages you'll notice that the default behavior is to set
focus to the Previous button when you hit enter! Awesome built in
feature if you design your wizards to go backwards! To fix that I had
to set the values of UseSubmitBehavi or.
<StepNavigation Template>
<asp:Button ID="StepPreviou sButton"
UseSubmitBehavi or="False" runat="server" CausesValidatio n="False"
CommandName="Mo vePrevious"
Text="Previous" />
<asp:Button ID="StepNextBut ton" UseSubmitBehavi or="True"
runat="server" CommandName="Mo veNext" Text="Next" />
</StepNavigationT emplate>
You've probably found a way to do this by now... but I figured I'd post
a solution anyways.
Now I'm having problems getting this to work with my Login Control
since I can't seem to figure out how to reference the submit button.
-Jennifer
Hi, sh*****@gmail.c om wrote:
Now I'm having problems getting this to work with my Login Control
since I can't seem to figure out how to reference the submit button.
haven't tried, but since ...
Page.Form.Defau ltButton =
Wizard1.FindCon trol("StartNavi gationTemplateC ontainerID$Star tNextButton").U niqueID;
.... did the trick for the wizard-control, shouldn't an analogous or similar
approach work for the login-control as well?
When I stumbled over that behaviour I also read tons of articles, blogs and
the such, without any hint leading to a work-around or "true" solution.
Hence the simple remedy that I posted. However, my solution sure seems
inappropriate in that it actually adds a superfluous control which someone
that reads the code will have to find out about. But time's expensive and
that approach is integrated quickly ... ;-)
And - thanks for posting your remedy. Keep us posted if you find one for
the login-control too!
Cheers,
Olaf
--
My .02: www.Resources.IntuiDev.com This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: dotnetjose |
last post by:
Hi Folks,
My subject message pretty musch explains it. By Default the Form
definition sits at the Master Page file.
Is there a way I can access the setting from my Content Page that uses
a Master Page?
Thanks in advance.
|
by: clickon |
last post by:
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";
|
by: clickon |
last post by:
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";
|
by: raghav |
last post by:
Hi
I am working on ASP.NET 2.0. I am developing a website using Wizard
control. Based on number of steps added, next, previous, finish buttons
generate automatically. After running the application, these button
work automatically, means we can go to next step, previous step by
clicking on corresponding buttons. In my application I have 3 steps. On
Next button click of step 1, I want two things to happen. One is
inserting data of step 1 in...
|
by: Chinnala |
last post by:
All,
I have a "Search" button and "Cancel" button on a web page. When I hit
enter, the "Cancel" button receives the focus and btnCancel event is
fired. But I want the search button event to be fired when I click
enter ? How can I implement this? Appreciate your replies.
Thanks,
Chinnala.
| |
by: Tim Mackey |
last post by:
hi,
asp.net 2. can anyone explain why this code does not work in firefox
(2.0.0.1), but does work in IE 7.
if you hit enter after typing something into the textbox, it should fire the
Submit button click handler, instead it fires the event for the bogus button
above it. btw it doesn't matter if i set it to ClientID, UniqueID or
"btnSubmit" hard-coded, they all fail.
<form id="form1" runat="server">
<asp:Button ID="Button1"...
|
by: Axel Dahmen |
last post by:
Hi,
trying to submit an ASPX form using the key (using IE6) the page is not submitted in my web project.
Trying to debug the pages' JavaScript code I noticed that there's some ASP.NET client script code being executed having a flaw:
function anonymous() {
if (!ValidatedTextBoxOnKeyPress(event)) { event.cancelBubble = true; if (event.stopPropagation) event.stopPropagation(); return false; }
}
|
by: Veerle |
last post by:
Hi,
When you use multiple asp:Buttons on one Form, then asp.net generates
html submit buttons for all of them. When you put your cursor in one
of the textfields of the form, the default submit button is the first
submit button of the form. So if you press enter, then the form is
submitted as if you pressed the first submit button of the form. But
sometimes, you want the default button to be the second or third
submit button of your...
|
by: GaryDean |
last post by:
I have a Wizard page and need to affect the next and previous buttons from
my code-behind. I've googled around and found two solutions, and neither
appear to work.
I can access the SideBarList steps successfully with the following code...
Control myContainer =
(Control)Wizard1.FindControl("SideBarContainer");
DataList mySideBarList =
(DataList)myContainer.FindControl("SideBarList");
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
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,...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |