Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Disable the prev button in a wizard

Reply
Thread Tools

Disable the prev button in a wizard

 
 
David Thielen
Guest
Posts: n/a
 
      01-27-2007
Hi;

How can I disable the prev button in a wizard from my C# code behind? On the
last page a prev is not allowed.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm


 
Reply With Quote
 
 
 
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      01-29-2007
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 ((E-Mail Removed), 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.

 
Reply With Quote
 
 
 
 
Walter Wang [MSFT]
Guest
Posts: n/a
 
      01-29-2007
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 ((E-Mail Removed), 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing Wizard Next/Prev buttons GaryDean ASP .Net 9 07-11-2008 02:18 AM
How to prevent FileUpload from uploading on Prev click in a wizard? Bogdan ASP .Net 1 05-31-2008 01:57 AM
add a link button to prev/next in a wizard David Thielen ASP .Net Web Controls 2 10-01-2006 10:55 PM
Data Grid Paging Prev button does not fire the PageIndexChanged ev Mike Lashbrook ASP .Net Web Controls 0 07-16-2004 11:50 PM
remove prev button in template olivier ASP .Net Mobile 0 04-28-2004 01:39 PM



Advertisments