动态执行剃刀视图剃刀、视图、动态

2023-09-04 10:19:03 作者:顾念

有没有办法动态地执行剃刀看法?如果我有看法code作为一个字符串,我可以执行它,并把它传递一个模型,例如参数?

Is there a way to execute a razor view dynamically? If I have the view code as a string, can I execute it and pass it a model as a parameter for example?

推荐答案

这不正是你问什么,但对使用动态生成的模板一些有趣的信息:的 http://buildstarted.com/2010/09/29/razor-view-engine-without- MVC不惜一切/

This isn't exactly what you asked about, but has some interesting info on using dynamically generated templates: http://buildstarted.com/2010/09/29/razor-view-engine-without-mvc-at-all/