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

前端 未结 3 761
醉梦人生
醉梦人生 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: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.

提交回复
热议问题