Getting fiddler to intercept local request, including requests to Cassini

Posted by Mikael Östberg | Filed under , ,

This is probably something everybody knew but me, but I'll put it here so that I never ever forget it.

It can be very interesting to see what an HTTP based application is actually requesting and that is probably why Fiddler was born. As a developer using Visual Studio and its built-in web server Cassini, I too am interested in what's going on under the hood.

I start my web project from Visual Studio, Explorer opens up. I start fiddler only to see nothing. After a bit of digging online I find that this is easy to solve.

Change http://localhost:1337 to 127.0.0.1.:1337 and fiddler starts tracking my requests.

Note the . before the : in 127.0.0.1.:1337 because that's where the magic is.

Happy fiddling!

Nested ListViews with DataPager and custom data source

Posted by Mikael Östberg | Filed under ,

A while back a client ran in to some performance issues using a ASP.NET ListView control along with nested ListViews to enable some grouping capabilities. It worked fine for about 50 rows and a small amount of groups, but one of their customers had over 1000 rows grouped into 15 groups. The page could really use some paging. Without paging, the page took quite a while to render.

I made a sample for them on how to use nested ListView controls with paging on both the outer and the inner ListView controls using the DataPager control. In the sample I also included LinkButtons in both the outer and the inner ListViews to show how to handle command events from within the ListViews.

Live demo of the Nested ListView with DataPager and Custom DataSource sample.

Download the source code

How to prevent web.config inheritance in ASP.NET

Posted by Mikael Östberg | Filed under ,

While setting up this blog, I ran into a configuration issue.

I wanted the blog to be on the URL devva.net/blog so I thought a Virtual Directory would do the trick.

On the root of devva.net, I'm currently running N2CMS. That CMS has the possibility to run several sites in the same installation and I didn't want all of the other sites to have /blog. Neither did I want to run two separate copies of the CMS code.

The solution was a new Web site in IIS pointing the home directory to the CMS Web site directory and then a Virtual Directory pointing to the directory containing BlogEngine.NET.

The problem with that is that the Virtual Directory inherits all the configuration settings from the Web.config in N2CMS, running in the root. This led to several problems like HttpHandlers not being found and such, which isn't strange at all. However, I still wanted this particular setup, so I started looking around on how to prevent web.config settings inheritance from an IIS WebSite to a child Virtual Directory and found a very good solution from Rick Strahl.

As stated in his post, I wrapped the <system.web> section in Web.config with <location inheritInChildApplications="false"> which solved the inheritance problem and as you can see, this blog is working perfectly.