各位大哥我做了一个
b.aspx(b:PageBase)   继承了PageBase(PageBase:System.Web.UI.Page)这个类又做了一个b.ascx 这个b.ascx如何才能用到PageBase的内容呢?

解决方案 »

  1.   

    PageBase page = this.Page as PageBase
    if( page != null )
      

  2.   

    在b.ascx中:PageBase page = this.Page as PageBase;
    if (page != null)
    {
        // do something with PageBase
    }
      

  3.   

    //获得父页面
            Page p = this.Parent.Page;
           Type pageType = p.GetType();
            MethodInfo mi = pageType.GetMethod("A");
    用户控件与用户控件之间调用:
            Page p = this.Parent.Page;
            b uc = p.FindControl("b") as b;
           Type pageType = uc.GetType();