Question

How can I use the CreateUserWizard control without having it render html tables?

I've customized the layout of the CreateUserWizard, and I'm using css to style it. My button is too far away from my form, due to the <table> tags asp.net is rendering by default.

<table cellspacing="0" cellpadding="0" id="cphContent_CreateUserWizard1" style="border-collapse: collapse; ">
    <tbody>
        <tr style="height: 100%; ">
            <td>
                <table cellspacing="0" cellpadding="0" style="height: 100%; width: 100%; border-collapse: collapse; ">
                    <tbody>
                        <tr>
                            <td style="height: 100%; width: 100%; ">
                                <fieldset>
                                    ...
                                </fieldset>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </td>
        </tr>
    </tbody>
</table>
Was it helpful?

Solution 3

You simply can not remove the table-tag from the control because the control is formatted this way.

OTHER TIPS

The CreateUserWizard doesn't have the RenderOuterTable property, but you can remove the table by using a LayoutTemplate and PlaceHolders (just like the ListView control).

This is an example:

<asp:CreateUserWizard runat="server" ActiveStepIndex="1"> 
  <LayoutTemplate> 
    <asp:PlaceHolder ID="WizardStepPlaceHolder" runat="server" />
    <asp:PlaceHolder ID="navigationPlaceHolder" runat="server" />
  </LayoutTemplate> 

  <HeaderTemplate>
    Header 
  </HeaderTemplate> 

  <StepNavigationTemplate>
    <asp:LinkButton runat="server" CausesValidation="False" CommandName="MovePrevious" Text="Previous" ID="StepPreviousButton">Previous</asp:LinkButton>
    <asp:LinkButton ID="NextLinkButton" runat="server" CommandName="MoveNext">Next</asp:LinkButton>
  </StepNavigationTemplate>

  <WizardSteps> 
    <asp:CreateUserWizardStep runat="server"> 
      <ContentTemplate> 
      </ContentTemplate> 
    </asp:CreateUserWizardStep> 

    <asp:CompleteWizardStep runat="server"> 
      <ContentTemplate> 
      </ContentTemplate> 
    </asp:CreateUserWizardStep> 
  </WizardSteps> 
</asp:CreateUserWizard> 

You can do this from design view and have visual studio generate the markup into template you can modify. In design view, click on the createUserWizard control, click on the angle bracket (>) at the top-right corner, then click Customize Create User Step. Switch to code and edit the markup to taste!!

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top