Why Do IsPostBack and Master.IsPostBack Always Fire Twice?

J

Joey

I am currently working on a (file-system) website in C# in VS2005. I am
programming counters for the different webpages. I wrote a class and
enum with functionalities exposed like...

Counter.Hit(PageCounter.Home)

....and then I put it in the Page_Load section and within the
if(!Page.IsPostBack) block on my web form.

I can see that during debugging that the !Page.IsPostBack block fires
and tests true (the code within is executed) TWICE each time the page
is viewed.

This is really weird. Why does it do it twice each time? This page is
webform that is linked to a master page, if that makes any difference.

I also tried !Page.Master.IsPostBack, but I got the same behavior.

Does anyone have any ideas on this? I can't afford to have my counter
hit twice each (one) time a page is accessed!

Thanks.
 
Joined
Oct 9, 2008
Messages
2
Reaction score
0
Review your aspx page to see whether any image control which has its src or imageUrl is empty. Give some static url to that attribute.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top