在asp.net 2.0中,如果在一個masterpage頁面中,使用服務端的table控件的話,如下所示,會在設置視圖時,沒了其中的contentplaceholder,
<asp:table id="tbl" runat="server">
<asp:tablerow>
<asp:tablecell>
this is my header!
</asp:tablecell>
</asp:tablerow>
<asp:tablerow>
<asp:tablecell>
<asp:contentplaceholder id="_content" runat="server">
</asp:contentplaceholder>
</asp:tablecell>
</asp:tablerow>
<asp:tablerow>
<asp:tablecell>
this is my footer!
</asp:tablecell>
</asp:tablerow>
</asp:table>
而如果用普通的頁面table的話,則不會出現如下的問題,
<table>
<tr>
<td>
this is my header!
</td>
</tr>
<tr>
<td>
<asp:contentplaceholder id="_content" runat="server">
</asp:contentplaceholder>
</td>
</tr>
<tr>
<td>
this is my footer!
</td>
</tr>
</table>
微軟已經確認是個小bug拉,將會在下一個版本解決,具體參考:
http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=6345496f-76eb-4e6c-aa95-791bfbfc24a0
出處:jackyrong blog
新聞熱點
疑難解答
圖片精選