How do i specify CodeFileBaseClass from web.config?

后端 未结 1 782
粉色の甜心
粉色の甜心 2020-12-12 05:16

i1 am registering a user control Control in web.config:


    
       <         


        
相关标签:
1条回答
  • 2020-12-12 05:39

    Try this:

    <system.web>
        <!-- ... -->
        <pages pageBaseType="MyWeb.UI.MyPageBase" />
        <!-- ... -->
    </system.web>
    

    Also, Refer below links:

    http://blogs.msdn.com/b/tom/archive/2008/08/22/known-issues-for-asp-net-with-net-3-5-sp1.aspx

    http://forums.asp.net/t/1305800.aspx

    Suggested Workarounds:

    If the pageBaseType class (for example, MyBasePage) is not needed for all pages, you can remove it from the web.config file, or

    Where pages do require the pageBaseType value, modify the classes in the code-behind files to extend the base type. In the filename.aspx.cs code-behind file, make sure that the class inherits from the pageBaseType that is specified in the web.config file (for example, public partial class CodeFileClass : MyBasePage instead of public partial class CodeFileClass : System.Web.UI.Page).

    An alternative workaround will allow you to add the following attribute to your page directive:

    CodeFileBaseClass="System.Web.UI.Page"
    
    0 讨论(0)
提交回复
热议问题