比如有一个MasterPage.master、A.aspx、B.aspx两个aspx页面中都用到了MasterPage.master,有什么办法可以知道当前是A还是B页面吗??

解决方案 »

  1.   

    <asp:Content ID="regatt_00" ContentPlaceHolderID="CostumContent" Runat="Server"></asp:Content>有没有办法得到regatt_00??
      

  2.   

    QUOTE:<asp:Content   ID="regatt_00"   ContentPlaceHolderID="CostumContent"   Runat="Server"> </asp:Content> 
    -------------------
    在母版页
            string cid = string.Empty;
            foreach (Control c in this.Controls)
            {
                if (c.GetType() == typeof(ContentPlaceHolder))
                    cid = c.ID;
            }
      

  3.   

    QUOTE: <asp:Content       ID="regatt_00"       ContentPlaceHolderID="CostumContent"       Runat="Server">   </asp:Content>   
    ------------------- 
    在母版页 
                    string   cid   =   string.Empty; 
                    foreach   (Control   c   in   this.Controls) 
                    { 
                            if   (c.GetType()   ==   typeof(ContentPlaceHolder)) 
                                    cid   =   c.ID; 
                    }************************
    好象不行啊,
    if   (c.GetType()   ==   typeof(ContentPlaceHolder)) 
    没有一个符合上面这个条件的啊