Pregunta

I have an asp.net wizard and I want the navigation controls (the next/previous buttons) to appear at the top instead of the bottom of the wizard.

Is there a simple way to set the location of the navigation area in the Wizard?

Or will I have to resort to have empty StartNavigationTemplate, StepNavigationTemplate, FinishNavigationTemplate so that standard navigation controls won't show, and then add div elements with custom buttons for the navigation?

<asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" Width="95%" DisplaySideBar="False"
    FinishCompleteButtonType="Link" FinishPreviousButtonType="Link" StartNextButtonType="Link"
    StepNextButtonType="Link" StepPreviousButtonType="Link" OnActiveStepChanged="Wizard1_ActiveStepChanged"
    OnNextButtonClick="Wizard1_NextButtonClick" 
    OnFinishButtonClick="Wizard1_FinishButtonClick">
    <HeaderStyle HorizontalAlign="Center" Font-Bold="True" />
    <HeaderTemplate>
        Edit User Wizard
        <br />
        <br />
        <div style="text-align:left">
            <asp:Label ID="lblStepTitle" runat="server" Text="Step Title"></asp:Label>
        </div>
    </HeaderTemplate>
    <StartNavigationTemplate>

    </StartNavigationTemplate>
    <StepNavigationTemplate>

    </StepNavigationTemplate>
    <FinishNavigationTemplate>

    </FinishNavigationTemplate>            
    <WizardSteps>

    </WizardSteps>
</asp:Wizard>
¿Fue útil?

Solución

Here's a way I found to re-arrange the wizard areas relative to each other, using LayoutTemplate element and asp:PlaceHolder control for each wizard area (header, sidebar, step, navigation); only thing I had to do was moving the navigationPlaceHolder above the headerPlaceHolder; now navigation controls appear at the top of the wizard, which what I wanted.

<asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" Width="95%" DisplaySideBar="False"
    FinishCompleteButtonType="Link" FinishPreviousButtonType="Link" StartNextButtonType="Link"
    StepNextButtonType="Link" StepPreviousButtonType="Link" OnActiveStepChanged="Wizard1_ActiveStepChanged"
    OnNextButtonClick="Wizard1_NextButtonClick" 
    OnFinishButtonClick="Wizard1_FinishButtonClick">
    <HeaderStyle HorizontalAlign="Center" Font-Bold="True" />
    <LayoutTemplate>
        <asp:PlaceHolder ID="navigationPlaceHolder" runat="server"/>
        <asp:PlaceHolder ID="headerPlaceHolder" runat="server" />
        <asp:PlaceHolder ID="sideBarPlaceHolder" runat="server" />
        <asp:PlaceHolder ID="WizardStepPlaceHolder" runat="server" />
    </LayoutTemplate>
    <HeaderTemplate>
        Edit User Wizard
        <br />
        <br />
        <div style="text-align:left">
            <asp:Label ID="lblStepTitle" runat="server" Text="Step Title"></asp:Label>
        </div>
    </HeaderTemplate>          
    <WizardSteps>

    </WizardSteps>
</asp:Wizard>
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top