我正在试着把一个asp.panel放在一个超文本标记语言的表格里。但是100%的桌子高度并没有填满asp.panel的空间。有人有解决这个问题的办法吗?
这是我的母版页的一个示例:
<table id="TableContent" bgcolor="#565757" border="0" height="100%" cellspacing="5" cellpadding="0">
<div id="content">
<asp:contentplaceholder id="MainContent" runat="server">
<tr>
<td><!-- Page-specific content will go here... --></td>
</tr>
</asp:contentplaceholder>
</div>
</table>
这是面板的代码。
<td align="center">
<form id="kunstenaars" runat="server">
<asp:Panel ID="Panel1" runat="server" BackColor="#565757" BorderColor="White" EnableTheming="False" EnableViewState="False" ScrollBars="None" style="position: relative; left: auto; width: auto; height: auto; z-index: 2;">
<asp:Literal ID="litKunstkoop" runat="server"></asp:Literal>
<asp:HiddenField ID="hdSoort" runat="server" />
<asp:SqlDataSource ID="Afmetingen_Datasource" runat="server" ConnectionString="<%$ ConnectionStrings:cnnSmelikStokkingWeb %>" SelectCommand="SELECT [Afmeting] FROM [Afmetingen] ORDER BY [Afmeting]" ProviderName="System.Data.SqlClient"></asp:SqlDataSource>
<asp:Label ID="lblAfmeting" runat="server" BackColor="#565757" Font-Bold="True" Font-Names="Verdana" Font-Size="Small" ForeColor="White" style="z-index: 1; left: 277px; top: 77px; position: absolute; width: 157px" Text="Kies afmeting" Visible="False"></asp:Label>
<asp:HiddenField ID="hdFotoCount" runat="server" Visible="False" />
<asp:HiddenField ID="hdTaal" runat="server" />
<asp:TextBox ID="van" runat="server" BackColor="#565757" Font-Bold="True" Font-Names="Verdana" Font-Size="X-Small" ForeColor="White" ReadOnly="True" style="z-index: 1; top: 79px; text-align: center; position: absolute; align-content: center;width: 31px; left: 630px" BorderColor="#999999">1</asp:TextBox>
<asp:TextBox ID="streep" runat="server" BackColor="#565757" Font-Bold="True" Font-Names="Verdana" Font-Size="X-Small" ForeColor="White" ReadOnly="True" style="z-index: 1; top: 79px; text-align: center; position: absolute; align-content: center;width: 12px; left: 664px" BorderColor="#999999">-</asp:TextBox>
<asp:TextBox ID="tm" runat="server" BackColor="#565757" Font-Bold="True" Font-Names="Verdana" Font-Size="X-Small" ForeColor="White" ReadOnly="True" style="z-index: 1; top: 79px; text-align: center; position: absolute; align-content: center;width: 31px; left: 679px;" BorderColor="#999999">20</asp:TextBox>
<asp:ImageButton ID="btBW" runat="server" ImageUrl="Images/Goback.png" style="z-index: 1; left: 611px; top: 80px; position: absolute; height: 16px; width: 16px" />
<asp:ImageButton ID="btFW" runat="server" ImageUrl="Images/Goforward.png" style="z-index: 1; left: 723px; top: 79px; position: absolute; height: 16x; width: 19px" />
</asp:Panel>
</asp:Panel>
</form></td>
我希望有人对此有一个解决方案。
发布于 2014-01-03 04:22:20
来自aspx页面的内容将替换asp:contentplaceholder。不要在母版页的占位符内添加其他内容。只需将占位符文本放在您想要放置内容的位置。
<table>
<tr><td>
<asp:contentplaceholder />
</td></tr>
</table>
发布于 2014-01-03 04:45:37
您可以在表格单元格内移动ContentPlaceHolder
,也不能直接在表格内嵌套div
<div id="content">
<table id="TableContent" bgcolor="#565757" border="0" height="100%" cellspacing="5" cellpadding="0">
<tr>
<td>
<!-- Page-specific content will go here... -->
<asp:contentplaceholder id="MainContent" runat="server">
</asp:contentplaceholder>
</td>
</tr>
</table>
</div>
https://stackoverflow.com/questions/20889361
复制相似问题