Interfaces

Project

Pages DebugMiddleware

NuGet packageOwin.Framework.Pages.DebugMiddleware
GitHub sourceOwinFramework.Pages.DebugMiddleware

Home |  Readme

Allows you to add ?debug=xxx to your website page URLs to see diagnostic information about page construction and data binding

This middleware provides a debug view of web pages produced by the Pages middleware.

To use this middleware add it to the OWIN pipeline then run your code and request pages from your website but include debug=true in the query string of the page.

When you do this, instead of rendering the page itself, the Debug Middleware will intercept the request and render a page showing how that page would be rendered, including how the data binding context will be established etc.

Adding this middleware to the Owin pipeline

 builder.Register(ninject.Get<OwinFramework.Pages.DebugMiddleware.DebugInfoMiddleware>())
    .As("Pages debug");    
The assumes that you are using Ninject as your IoC container, and followed the getting started walkthrough. If this is not the case then you will need to adjust the code to work in your application.

Displaying Debug Information

You can view debug information for any page that is produced by the Pages middleware by adding a query string parameter to the page URL. Below are some examples:

    http://mywebsite.com/folder/page1?debug=true
    http://mywebsite.com/folder/page1?debug=xml
    http://mywebsite.com/folder/page1?debug=json
    http://mywebsite.com/folder/page1?debug=html
    http://mywebsite.com/folder/page1?debug=svg

Enhancing Debug Information

If you write custom regions, layouts, components etc, you can include more detailed information in the debug output by overriding a protected method of the base class called PopulateDebugInfo<T>.