Tag Archives: webforms

Putting WebForms DataBinding front and centre

The previous release of Glimpse saw the introduction of first class WebForms support, bringing with it a contextualized view of both the Control Tree hierarchy and the Page Life Cycle. Glimpse WebForms development has been continuing apace and with this new release we’re delighted to shed some light on the previously dark art of WebForms DataBinding.

WebForms ‘DataBlinding’
DataBinding is to WebForms what ModelBinding is to MVC and is an essential ingredient in building maintainable and testable WebForms code. But until now, understanding when a DataBind occurs has been pretty much a mystery. For example, a change to the Page’s PostBack status or a Control’s ViewState mode can have dramatic effects on when DataBinds are triggered. Changing a DataBound Parameter value is another way to fire a DataBind, the Text of a TextBox for example, but keeping track of these values as the Page moves through its Life Cycle hasn’t been easy.

Glimpse to the rescue
We’ve added a new DataBinding section to the Control Tree tab. Alongside each DataBound Control we list the Page Life Cycle Events during which a DataBind was triggered for that Control. The screenshot below shows that the categoryList was DataBound once during the Page PreRender Event.

DataBinding Event

You may be thinking this information can only be displayed if you’re using the latest .NET 4.5 DataBinding approach, more akin to the ModelBinding architecture of MVC. But you’d be wrong. The Event information is displayed for all Controls inheriting from DataBoundControl, for example the ListView and FormView (but not the DataGrid or DataList), irrespective of how they were DataBound.

We haven’t stopped there. Together with the Event we also display the Parameters in play at the time the DataBind happened. The screenshot below shows the breakdown of the Parameters used when the productList was DataBound in the PreRender phase. The first Parameter looked for, but didn’t find, the id field in the QueryString; the second Parameter found a value of ‘Cars’ in the RouteData categoryName field.

DataBinding Parameters

Once again, this Parameter display isn’t limited to .NET 4.5 DataBinding. Provided the Parameters are registered using an ObjectDataSource, LinqDataSource or SqlDataSource the information can be extracted just the same.

Glimpse 1.8.2 released

Its a new year and we have a new release ready to go out the door. This time around, we have a ton of bug fixes and a few new features here and there. This release represents the most contributions Glimpse has ever had in a single release, as well as having the greatest number of contributors.

WebForm support for DataBinding
Since our initial support for WebForms was released, the response from the community has been amazing. Not only have we discovered that WebForms developers have been seeking innovations in the space, but have been wanting to get involved. This has lead to Graham Mendick and Steve Ognibene stepping forward to make sure the WebForms package keeps moving forward.

This has lead to DataBinding visualization being added to the Control Tree tab within Glimpse. More details will com in a future blog post, but the short version is that we can now see all the actions that WebForms takes to bind your controls.
WebForms_DataBinding

ASP.NET Server tab
In a previous release, we removed the old version of the Server tab. This was removed as a lot of the data we where displaying was being shown elsewhere. Since then, we have found that some users missed the data that wasn’t being displayed elsewhere. Hence, the Server tab has made a come back and has received a bit of a facelift thanks to Bryan Hogan.
ServerTab

Glimpse Insights support
Along with this release, we are putting out Glimpse Insights. As discussed in the post, this is the means by which we hope to better understand how people use Glimpse and where we should be focusing out efforts.

As much as we need these insights to make better decisions and ultimately a better product, if its something that you don’t want to take a part in, you can completely opt-out. Simply update the Glimpse section in your web.config to have the following addition:

    <clientScripts>
      <ignoredTypes>
        <add type="Glimpse.Core.ClientScript.Insight, Glimpse.Core"/> 
      </ignoredTypes>
    </clientScripts>

If you do opt-out, there will be no traces of Insights in your code base. Insights was designed not simply to be a switch on or off, but to be a complete removal. Meaning no traces of the Insights code will remain if you choose to opt out.

Release Notes

  • Glimpse.Core – Featherweight release 1.8.2
    • Update to disabled Glimpse when request init is bypassed
    • Update client to only modify local ajax requests
    • Add initial support for Glimpse.WindowsAzure and Glimpse.WindowsAzure.Storage
    • Update to show friendly message if current async implementation is not supported
    • Added initial Insights support to client
    • Update client to delayed tab rendering till glimpse open
    • Update client to added more blacklist items for target chars that should be ignored by case processor
  • Glimpse.ASP.NET – Welterweight release 1.8.0
    • Update Route Inspector to ignore non AspNet based routes (this fixes problems with Glimpse and WebAPI)
    • Added updated Server Tab which shows common server variables
    • Clean up web.config transform to remove volume of commented out config in the glimpse section
    • Update Request Tab serialization to handle request validation failures
  • Glimpse.MVC* – Flyweight release 1.5.3
    • Added updated support for IUnvalidated and IEnumerable ValueProviders
    • Fixed problem where Response.RedirectToRoute() in Global.asax could throw a NullReferenceException
  • Glimpse.WebForms – Lightweight release 1.1.0
    • Added visualization for DataBinding in the ControlTree Tab
    • Improve basic ViewState processing for SqlDataSource, LinqDataSource and ObjectDataSource

Special Thanks
In terms of pull requests, I have to say a big thanks to:

  • Christophe Gijbels
    • #704 Disabled Glimpse when request init is bypassed
    • #702 Update Request Tab serialization to handle validation failures
    • #701 Added update for IUnvalidated and IEnumerable ValueProviders
  • Keith Dahlby
    • #688 Show friendly message if current async implementation is not supported
  • Paul Atkins
    • #723 Update Route Inspector to ignore non AspNet based routes
  • Bryan Hogan
    • #712 Adding updated Server Tab which shows common server variables
  • Graham Mendick and Steve Ognibene
    • #716 Update WebForms Control Tab to visualize DataBinding

And for the great issue reports, I want to thank:

Release Details
Well I think that is a wrap. For a full list of changes, issues and commits see below:

Thanks to everyone involved and enjoy the release!