title: How to render a Razor View to a string in ASP.NET MVC 3?
body: <p>I've been searching the site a lot, but all I could find were examples on how to render partial controls <code>.ascx</code>, or depended on a controller context.</p>
  
  <p>I want a method that enables me to provide just the relative path to the view, and a model, and render that view with that model into a string:</p>
  
  <pre><code>string result = Utility.RenderViewToString("~/Views/My/Profile.cshtml", model);
  </code></pre>
  
  <p>All the examples I could find were either for older versions of MVC, or simply didn't do what I need to do here.</p>