[英]What is best practice to load text in an MVC website?
Can somebody suggest what is the best practice to load text(which has 2-5 paragraphs) in razor page, either by getting text load from word document(write ac# class to parse word document and through controller pass the data to view) or directly embedding the text in the Razor page ? 有人可以建议通过在Word文档中加载文本(编写ac#类以解析Word文档并通过控制器将数据传递给视图)来在剃刀页面中加载文本(具有2-5个段落)的最佳做法是什么,或者直接在Razor页面中嵌入文本?
Thanks 谢谢
If you don't expect the text to change then just write it in your Razor view. 如果您不希望文本更改,则只需在Razor视图中编写即可。
If the text might change, and you don't want to re-publish every time, then you can have the controller read it from a file or database and pass it to the Razor view. 如果文本可能更改,并且您不想每次都重新发布,则可以让控制器从文件或数据库中读取文本并将其传递到Razor视图。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.