开发者

How to Render content include razor syntax in asp.net mvc 3

In my database there is a record which include some razor 开发者_开发百科syntax like that "Hello @Model.Name, Wellcome ..." When I get this record to the view how can I render this model property ?

Thanks,


There are many ways.

  1. Pulling a View from a database rather than a file
  2. http://razorengine.codeplex.com
  3. http://ibashir.blogspot.com/2010/11/razor-parser-without-mvc.html
  4. http://blog.andrewnurse.net/2010/07/22/UsingTheRazorParserOutsideOfASPNet.aspx

I'm biased towards the RazorEngine from codeplex it's been used in the Mini-Profiler from the developers of this very site.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜