在 DIV 布局而不是 TABLE 布局中呈现 asp.net 向导控件

Rendering asp.net Wizard control in DIV layout instead of TABLE layout

我在一个项目中使用了 ASP.NET 向导控件,它在那里运行良好。但是向导正在 TABLE 布局中呈现它的 html。我需要将渲染机制转换为 DIV 而不是 TABLE 布局。在互联网上做了一些研究后,我发现我们可以使用 LayoutTemplate 但我无法实现它。有没有更好的解决方案,或者是否有人已经遇到过这样的问题并按照我需要的方式实施。任何帮助!

当 Wizard 控件呈现 HTML 时,它会显示呈现的 HTML 特别是 LayoutTemplate 的占位符。占位符的名称应与代码中的名称相同。

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Wizard LayoutTemplete Demo</title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:Wizard ID="Wizard1" runat="server" DisplaySideBar="False" Width="100%">
            <LayoutTemplate>
                <div>
                    <asp:PlaceHolder ID="headerPlaceHolder" runat="server" />
                </div>
                <div>
                    <asp:PlaceHolder ID="WizardStepPlaceHolder" runat="server" />
                </div>

                <div>
                    <asp:PlaceHolder ID="sideBarPlaceHolder" runat="server" />
                </div>

                <div style="float: right">
                    <asp:PlaceHolder ID="navigationPlaceHolder" runat="server" />
                </div>
            </LayoutTemplate>

            <SideBarTemplate>
                <asp:ListView ID="sideBarList" runat="server">
                    <LayoutTemplate>
                        <div id="ItemPlaceHolder" runat="server" />
                    </LayoutTemplate>

                    <ItemTemplate>
                        <asp:LinkButton ID="sideBarButton" runat="server" Text="Button" />
                    </ItemTemplate>
                </asp:ListView>
            </SideBarTemplate>

            <HeaderTemplate>
                Header content goes here ...  
                <hr />
            </HeaderTemplate>

            <WizardSteps>
                <asp:WizardStep ID="WizardStep1" runat="server" Title="Step 1">
                    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc,


                </asp:WizardStep>
                <asp:WizardStep ID="WizardStep2" runat="server" Title="Step 2">
                    But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure? On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee


                </asp:WizardStep>
                <asp:TemplatedWizardStep ID="WizardStep3" runat="server" Title="Step 3">
                    <ContentTemplate>
                        <asp:Label ID="Label3" runat="server" Text="Label"></asp:Label><asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
                    </ContentTemplate>
                </asp:TemplatedWizardStep>
            </WizardSteps>
        </asp:Wizard>

    </form>
</body>
</html>