Page load fires twice on Firefox - PLEASE HELP !
Posted
by The_AlienCoder
on Stack Overflow
See other posts from Stack Overflow
or by The_AlienCoder
Published on 2010-01-28T09:52:17Z
Indexed on
2010/06/06
5:32 UTC
Read the original article
Hit count: 258
ASP.NET
OK 1ST SOME BACKGROUND - I have a page showing the number of hits(or views) of any selected item. The hit counter procedure that is called at every page load i.e
if (Request.QueryString.HasKeys())
{
// get item id from icoming url e.g details.aspx?itemid=26
string itemid = Request.Params["itemid"];
if (!Page.IsPostBack)
{
countHit(itemid);
}
}
THE PROBLEM - My expectation was that the counter would be increased by 1 on every page load but the counters on my datalist and formview are always behind and stepped by 2 i.e
instead of 1, 2, 3, 4 its - 0, 2 , 4, 6
It seems that the page load is firing twice. Later I discovered that this only happens when you are using Mozilla Firefox. The page behaves fine with other browsers like IE
This becoming quite frustrating. CAN ANY1 HELP :-(
© Stack Overflow or respective owner