Use the Glimpse beta with web forms

10 May 2011

This post is about Glimpse 0.81 which is obsolete, check this post about newer versions.

If you are not using MVC yet, but like to use some of the goodness of glimpse in your web forms sites, read on.

Requirements for the 0.81 version of Glimpse:

- A web forms site using ASP.NET 4
- jquery.js included on any page you want to glimpse into.
- MVC 3 (

Using nuget to add glimpse to your site in Visual Studio

Get nuget at

Use the nuget Package Manager Console,

or right click on your site and use the 'Add Library Package Reference'.

Install-Package Glimpse

in the console, or search for Glimpse in the GUI. The glimpse page on the nuget gallery is at

Manually add glimpse without Visual Studio

If you can't or don't want to install nuget, you can add Glimpse to your site manually.

Open the url to download the package.
Rename the .nupkg file to .zip and open it, navigate into /lib/net40 and copy the Glimpse.Net.dll
into the bin directory of your site.

Now open your web.config,

add or integrate the config section at the very top of the file (just after <configuration>)

    <section name="glimpse" type="Glimpse.Net.Configuration.GlimpseConfiguration" />
Add the following section anywhere within <configuration>
<glimpse on="true" saveRequestCount="5">
        <add address="" /><!--IPv4-->
        <add address="::1" /><!--IPv6-->
        <add contentType="text/html"/>

The Client Site Component

For MVC the required client site component is accessed through a route to /glimpse/glimpseclient.js
You could do the same in web forms, but you could also just drop the js file into that location.

Get the JavaScript file from
and save it into /glimpse/glimpseclient.js in your site.

You also want to grab the image at
and save it as /glimpse/glimpseSprite.png.

Now enable glimpse by opening /glimpse/config on your site and click the 'Turn Glimpse On' button.

Any aspx page that has jQuery included, you should now see the glimpse button in the lower right corner, click it to open the glimpse panel.

In your web.config add

    <add plugin="Glimpse.Net.Plugin.Mvc.MetaData"/>
    <add plugin="Glimpse.Net.Plugin.Mvc.Binders"/>
    <add plugin="Glimpse.Net.Plugin.Mvc.Execution"/>
    <add plugin="Glimpse.Net.Plugin.Mvc.Routes"/>
    <add plugin="Glimpse.Net.Plugin.Mvc.Views"/>

to the <glimpse section, this will hide the MVC extensions which are useless for web forms.


On one of my sites, the /glimpse/config page did not work, that was because I had Firefox's 'Content-Security-Policy' enabled
on the site which does not allow JavaScript to be executed within a html page. Make sure to turn that off for glimpse.

How does it all work?

I asked myself, how the additional glimpse JavaScript gets onto my page, after all I did not make any changes to the web.config
except for the configuration. I look at the source of glimpse reveals that they are using the new ASP.NET 4 feature 'PreApplicationStartMethod'
to add a http module to a site by just dropping an assembly into the bin directory. No changes to the web.config files are required.
Learn more about this at

Pages in this section


ASP.Net | Community | Development | IIS | IT Pro | Security | SQL (Server) | Tools | Web | Work on the road | Windows