Search code examples
asp.net-mvcpartial-viewstracerazor-2

MVC.NET Tracing Partials & Templates


Is there a way to get a trace of what cshtml files are being used to construct a particular page load? For instance:

  • /Views/Shared/_LayoutUser.cshtml
    • /Views/Shared/_UserNavigation.cshtml
    • /Views/Shared/_BannerSelector.cshtml
    • RenderBody - /Views/Users/Index.cshtml
      • /Views/Users/DisplayTemplate/User.cshtml
      • Anything else used to construct view
    • /Views/Shared/_UserFooter.cshtml

Solution

  • Try Glimpse. It works much like Firebug does, except for MVC. It shows the execution tree of your views/partials/layout in a tree that looks pretty much the same as you described, including their execution times. It's very extensible as well, and there are plugins to trace Entity Framework, and JavaScript, etc.