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

天涯浪子 提交于 2019-12-01 11:25:51
public int DivWidth { get; set; } 

Does this actually get implemented?

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.

this worked for me:

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

in .aspx file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!