RazorEngine output HTML

I have a little piece of code, which gets data from a DB, and I want to parse it into a .cshtml Razor-View-Template. therefor i create a variable of a new TemplateService and execute .parse() on that. Now I want to output the file to the user. What is the best performing function to accomplish this task? I have an MVC application. And as the text above already describes, this is a little template system.

Edit:

For example:

  • I have a folder templates/default-tpl/, which contains a file index.cshtml
  • This file contains some Razor-related variables (for example @ViewData["Title"]
  • Now i have a Controller, which calls the RazorEngine TemplateService's Parse() function with the corresponding ViewData.
  • Now I have the HTML ready and parsed
  • So the question is, from this point, how do i output the website the most performant way? Or is there even a complete different approach possible?

    链接地址: http://www.djcxy.com/p/65108.html

    上一篇: 你能否客观回答两个论点

    下一篇: RazorEngine输出HTML