Search code examples
c#asp.net-mvc-3debuggingrazorvisual-studio-debugging

Get current generated html while debugging mvc3 view


While stepping through the generation of a View. Is there a way to see the HTML that has been generated to that point? I've tried looking through the locals variable list, but am having trouble finding it.


Solution

  • You can look at the ViewContext.Writer. Try adding...

    ((System.Web.Mvc.WebViewPage)(this)).ViewContext.Writer
    

    to your watch window.