title: Rendering string as razor cshtml
body: <pre><code>public ActionResult Index()
  {
      return View("ViewName");  // cshtml file name
  }
  </code></pre>
  
  <p>That is normally works.</p>
  
  <pre><code>public ActionResult Index()
  {
      string razor = "&lt;p&gt;Date: @DateTime.Now&lt;/p&gt;";
      return View(razor);
  }
  </code></pre>
  
  <p>Can I do something like that? Not render a .cshtml file, render a string...</p>
  
  <p>-- Edit------</p>
  
  <p>I actually create .cshtml files programmatically. For example i gonna use @Html.TextBoxFor(...) or foreach statement in my string. – E-D just now edit </p>