Rita,
I see what you are saying. Your handler is called a few times because these are a few different requests.
If you take a look at the actual URL (put a break point in the code below) of your requests you'll see that these are calls to images, web services etc in addition to your actual page call. The first call is your page and then a browser (while it parsing the returned content) starts downloading images, running scripts and it produces several extra calls to the server that go in the same pipeline where your event handler is hooked.
RequestEvents.Begin.Execute += (sender, args) =>
{
var r = System.Web.HttpContext.Current.Request;
var url = r .Url;
var contentType = (r.AcceptTypes!= null)? r.AcceptTypes.FirstOrDefault() : "";
var extension = String.IsNullOrEmpty(r.CurrentExecutionFilePathExtension)? "": r.CurrentExecutionFilePathExtension;
if (contentType == "text/html")
{
// process here.
}
};
Images will have "image" present in there content type, web services will have " * /*". Your actual page will have "text/html".