|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Disable the prev button in a wizardHi;
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 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 (waw***@online.microsoft.com, 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. 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 (waw***@online.microsoft.com, 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.
Client Side ID Differs From Server Side ID
Why does OnClick event not work in 2.0 for DataGrid UpdatePanel, Postback can i assign a name for a control dynamically? Referencing Controls on ItemTemplate in FormView Control tie ENTER to a button? Why doesn't work DataFormatString for GridView.BoundField ? Repeater and Validators referencing a control in a webform that uses master page Web Parts - EditorZone - Changing the appearance of a web part |
|||||||||||||||||||||||