By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,965 Members | 1,476 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,965 IT Pros & Developers. It's quick & easy.

Application_BeginRequest is fired 2 times each time I do an action on the browser...

P: n/a
Hi, I hope someone could help me with this problem...

First, the context :
IIS : v5.1
Framework : v1.1
Language : C#
I have a main page (default.aspx) which is my server default page.
That I open http://localhost/MainProject/ or
http://localhost/MainProject/default.aspx, I have the
Application_BeginRequest fired 2 times... so the Default.Page_Load()
method occures 2 times too.

When I click any link button in my page, the Click event only occurs
the first time.

When I noticed this problem, I made a test.aspx so see if this page
does the same thing and NO. This one is only fireing
Application_BeginRequest one time.

Here are tests I tried :

- First I wrote a method : WriteDebug(string event) that writes "time
+ event + context id" to a file
I call this method on overridden OnInit() and CreateChildControl()
methods, on Page_Load() and Pre_Render() methods that are registered
to Load and PreRender System.Web.UI.Page EventHandlers.

- Second I change the default.aspx to test2.aspx and the problem is
still there.
Does anyone have encountered that problem before?
Anybody have a suggestion for me?
Nov 17 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
Hello Everyone, I found my problem and I can tell you that is a BUG in

I Explain:

I had a page that was fireing 2 requests each time I asked for an
action from the browser (Click a linkbutton, ... or even call it for
the first time..)

The problem was that in my <Body> tag.
Here are two possible ways to change the color or background image of
a page :
<body bgColor="#rrggbb"> (red-green-blue)
<body background="image.gif">

My error (which is not supposed to fire two requests) was that I had a
body tag like : <body background="#cccccc">
Probably a BUG from ASP.NET that was validating the file #cccccc as a
background! and I don't know why, but was fireing a second request
from the server...
Hope this bug could help some of you...

Nicolas Dion
Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.