Glimpse/Glimpse — pull request #716 by grahammendick (2014-01-27 22:39:06+00:00)
Title: Web Forms DataBinding support

DataBinding is the Web Forms equivalent to Model Binding in MVC. There are two different types of DataBinding in Web Forms for which Glimpse can meaningfully harvest data. The first is pre .NET 4.5 and uses DataSource Controls and the second is post .NET 4.5 and uses Model Binding. The aim of this PR is to capture the parameters used during DataBinding and for the data displayed to be consistent across both scenarios.

The initial proposal and subsequent discussion can be found under the Glimpse dev group post entitled 'Re: Glimpse Web Forms'. But for completeness I'll summarise the implementation.

A DataBoundControlAdapter is attached to all DataBoundControls. If pre .NET 4.5 DataBinding is used the parameters are extracted from the DataSource Control Parameters in the DataBinding listener attached in the Adapter. If post .NET 4.5 DataBinding is used the parameters are extracted from the ModelBindingContext in a ModelBinder Inspector. Once extracted, the parameters are stored in the HttpContext by the Adapter for subsequent retrieval by The ControlTree tab. PageLifeCycleMessages are used to display the parameters within the corresponding Page event.

A test page has been added to the WingTips sample, http://localhost:55555/DataBindingTests/ListView.aspx, that demonstrates a ListView DataBound using both types of DataBinding and involving a range of DataSource Controls, Parameters and ValueProviders.