asp:Wizard control - hiding "next" button on certain steps.

  • Thread starter Thread starter Nick Gilbert
  • Start date Start date
N

Nick Gilbert

Hi,

I'm using the asp:Wizard control and on some of the steps, I would only
like the user to be able to progess to the next step by clicking an
image button. Therefore I would like to be able to hide the Next button
on these steps.

Is there any way to do this?

I know you can convert the navigation to a template, but this is a
common template for all steps rather than a template for a particular step.

Thanks,

Nick...
 
Hi Nick,

You can use following steps to hide or show each step's next/prev button:

1) Add following CSS rules to your ASPX:

<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
.hidden { display: none; }
.visible { display: inline; }
</style>
</head>


You can find more information about CSS display here:

#CSS2 - The display declaration
http://www.quirksmode.org/css/display.html




2) Handle the Wizard's ActiveStepChanged event:

protected void Wizard1_ActiveStepChanged(object sender, EventArgs e)
{
if (Wizard1.ActiveStepIndex == 1)
{
Wizard1.StepNextButtonStyle.CssClass = "hidden";
}
else
{
Wizard1.StepPreviousButtonStyle.CssClass = "visible";
Wizard1.StepNextButtonStyle.CssClass = "visible";
}
}


Hope this helps.


Sincerely,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi Nick,

Thank you for sharing your solution. You're right that it's the CommandName
of a control that supports bubbling event controls Next or Previous step.
By removing the default StepNavigationTemplate content and using
CommandName, you have full control of how to show the navigation controls.


For more information about event bubbling:

#Bubbling an Event
http://msdn2.microsoft.com/en-gb/library/aa719644(VS.71).aspx

#Control.RaiseBubbleEvent Method (System.Web.UI)
http://msdn2.microsoft.com/en-us/library/system.web.ui.control.raisebubbleev
ent.aspx

#Event Bubbling Control Sample
http://msdn2.microsoft.com/en-gb/library/aa720044(VS.71).aspx


Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi

Please give some working code on how to access the next and previous
buttons. In which event I will write the code

Thanks

Arun
 
Back
Top