Disable the prev button in a wizard

W

Walter Wang [MSFT]

Hi Dave,

You could control the visibility using CSS:

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



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


Hope this helps.


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.
 
W

Walter Wang [MSFT]

Dave,

I just realized your question is to disable instead of hide. Since the
button is not exposed as a public property, you could use your own
FinishNavigationTemplate and disable the button inside it:

<FinishNavigationTemplate>
<asp:Button id="btnPrev" runat="server"
CommandName="MovePrevious" Enabled="false" Text="Previous" />
<asp:Button ID="btnFinish" runat="server"
CommandName="MoveComplete" Text="Finish" />
</FinishNavigationTemplate>

You could find these required CommandName in documentation of
FinishNavigateTemplate.


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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top