不知道能不能说清楚···
vs2008新建一个母板页时那个占位符把页面分成了上中下三部分,但是我想建个导航放在页面左边的母板页,不是上中下结构的那种,这个如何实现的?

解决方案 »

  1.   

    本来母版页就常用来做布局,占位符之所以叫占位符,就表示它只是占个位置,它本身不会构成布局。占位符你就当它是个 DIV 标签好了。给你一个正式的例子看下,你就明白了。<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server" id="MasterHead">
    <Layout:Head ID="layoutHead" runat="server" />
    <script type="text/javascript">
    <!--
    setInterval(queryTimeout, 60 * 1000);
    function queryTimeout() {
    var url = '<%= ResolveUrl("~/ajaxCommon.aspx")  %>?Method=QueryTimeout&r=' + Math.random();
    $.get(url, function(rs) {
    var timespan = rs - 0;
    var timeout = <%= Information.Timeout %>;
    if(timespan > timeout * 60)
    location.href = '<%= ResolveUrl(Information.LoginPage) %>';
    });
    }
    -->
    </script>
    <asp:ContentPlaceHolder ID="head" runat="server"></asp:ContentPlaceHolder>
    </head>
    <body>
    <form id="form1" runat="server">
    <table class="wrapper">
    <tr>
    <td colspan="2" class="header">
    <Layout:Header ID="layoutHeader" runat="server" />
    </td>
    </tr>
    <tr>
    <td rowspan="2" class="menu">
    <Layout:Left ID="layoutLeft" runat="server" />
    </td>
    <td class="prompt">
    <div class="logout"><input type="button" class="button" value="注销" onclick="location.href='<%= ResolveUrl(Information.LoginPage) %>'" /></div>
    <table style="float:left; margin-left:5px">
    <tr>
    <td class="prompt_content">
    <img src="<%= ResolveUrl("../images/icon/person.png") %>" /> <asp:Literal ID="ltWelcome" runat="server"></asp:Literal>
    </td>
    </tr>
    </table>
    </td>
    </tr>
    <tr>
    <td class="content" style="height:660px;">
    <Kidtech:Message ID="msg" runat="server" />
    <asp:ContentPlaceHolder ID="CenterPlaceHolder" runat="server"></asp:ContentPlaceHolder>
    </td>
    </tr>
    <tr>
    <td colspan="2" class="footer">
    <layout:Footer ID="layoutFooter" runat="server" />
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>
      

  2.   

    把默认的删除也可以啊,就在母版页中像写普通页面一样写布局。
    在需要留空的地方放一个ContentPlaceHolder就行了