博客引擎2.0错误
我在 Visual Studio 2010 设计器视图中打开 blogengine.net 2.0 时遇到错误。它显示母版页错误。
但在执行页面时,它正在正确加载。
I AM getting an error while opening blogengine.net 2.0 in visual studio 2010 designer view.It is showing the master page error.
But while executing the page it is loading correctly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您遇到了与此问题类似的问题。
这与 BlogEngine.net 在页面基类的 PreInit 事件中设置母版页有关 (BlogBasePage)。它根据您选择的主题来执行此操作。因此,在设计时 VS 无法弄清楚母版页是什么。
您可以在 web.config
指令中设置默认母版页文件,如上面问题的答案所示。您使用的母版页文件将基于您正在使用的主题 (/themes/yourtheme/site.master)。You have a similar problem to this question.
This has to do with the fact that BlogEngine.net is setting the Master Page in the PreInit event of the page's base class (BlogBasePage). It does this based on the theme you have chosen. Because of that, at design time VS can't figure out what the master page is.
You could set a default master page file in the web.config
<pages>
directive, as in the answer to the question above. The master page file you use would be based on the theme you are using (/themes/yourtheme/site.master).也许母版页是动态确定的?
尝试在代码(而不是设计器)中打开并查看
@Page
指令的MasterPageFile
属性的内容。Maybe the master page is determined dynamically?
Try opening in code (rather than designer) and seeing what the
MasterPageFile
attribute of the@Page
directive says.