首页 > 编程 > .NET > 正文

asp.net 2.0中tablecontrol搭配masterpage的小bug

2024-07-10 13:11:20
字体:
来源:转载
供稿:网友
注册会员,创建你的web开发资料库,

在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

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表