How do I solve the error 'System.Web.UI.MasterPage' does not contain a definition for

前端 未结 3 698
醉梦人生
醉梦人生 2021-01-15 01:13

I have two master pages and a content page. On my local machine this code works, but once I uploaded to the server I got the following error:

Compilation Error Desc

相关标签:
3条回答
  • 2021-01-15 01:39

    this worked for me:

    <%@ MasterType VirtualPath="~/MasterPage.master" %>
    

    in .aspx file

    0 讨论(0)
  • 2021-01-15 01:52

    Ok, here is the thing, this works sometimes and then when I add another property or recompile it would give me an error. it turns out it is compiler issue. To get around the issue, I had to create a App_Code directory under the root and made a class. When I get the error telling me there is no DivWidth defined, I simple make a code change in the class I created and the site compiles in the proper order. It took opening a case with MS, who was not very helpful, for me to find this workaround. Hope this helps someone else who runs into this strange issue.

    0 讨论(0)
  • 2021-01-15 02:01
    public int DivWidth { get; set; } 
    

    Does this actually get implemented?

    0 讨论(0)
提交回复
热议问题