MVC3 - 用剃刀意见缓存哪些内容? [英] MVC3 - What's with the caching of razor views?
问题描述
什么是如何确保剃刀视图呈现为最新的官网上?在它出现的那一刻,我得到一个缓存版本。
我有一个观点,即呈现一个部分,这部分呈现一个模板。
保存,编译,重置IIS:
同样的老看法!
住手吧!
让我给ü一个例子
@ Html.EditorForModel(〜/查看/共享/ EditorTemplates / Object.ascx)
渲染Object.ascx
删除线呈现什么(好)
然后加入
@ Html.EditorForModel(〜/查看/共享/ EditorTemplates / Huh.cshtml)
渲染Object.ascx
=疯狂。
发现它:它被称为Object.cshtml也没有所谓的对象能活的文件夹(例如Object.ascx)在其他控制。 p>
What is the official line on how to make sure a razor view is rendered as latest? At the moment it appears I am getting a cached version.
I have a view, that renders a partial and this partial renders a template.
Save, compile, iis reset:
Same old view!
Stop it now!
Let me give u an example
@Html.EditorForModel("~/Views/Shared/EditorTemplates/Object.ascx")
Renders Object.ascx
Remove that line renders nothing (good)
Then adding @Html.EditorForModel("~/Views/Shared/EditorTemplates/Huh.cshtml")
Renders Object.ascx
=Insanity.
Found it: it has to be called Object.cshtml and no other control called "Object" can live in that folder (e.g. Object.ascx).
这篇关于MVC3 - 用剃刀意见缓存哪些内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!