C# – asp.net wizard control non-clickable sidebar

asp.netcwizard

I have an asp.net wizard, and I want the user to navigate the control only with the next/previous buttons.

Anyway, I would like to set the sidebar so that it displays the step names with the current step highlighted, but without letting the user click on them.

Is this possible?

Best Answer

You can use a SideBarTemplate and set the Enabled attribute of the links to False:

<asp:Wizard runat="server" DisplaySideBar="true">
    <SideBarTemplate>
        <asp:DataList ID="SideBarList" runat="server">
            <ItemTemplate>
                <asp:LinkButton ID="SideBarButton" runat="server" Enabled="false" />
            </ItemTemplate>
            <SelectedItemTemplate>
                <asp:LinkButton ID="SideBarButton" runat="server" Enabled="false" CssClass="currentStep" />
            </SelectedItemTemplate>
        </asp:DataList>
    </SideBarTemplate>
    ...
</asp:Wizard>
Related Topic