A few days ago, Loïc Bar (
http://www.loicbar.com/) has posted a new feed to explain how to customize an ASP.NET application using master pages (and how to store this value in the user profile).
As added in the feed comments, I wanted to react to go a bit further.
Indeed this is typically an AOP problem that may (should) be adressed with AOP. You can find
here the original post of Loïc Bar.
And you can download
here my article explaining how to achieve the same goal using HttpModules in ASP.NET. This article will be my reference one for when speaking - later on - of HttpModules, as it shows, step by step, how to create it and how to handle it.