This project is read-only.

Twice requests on one click in Firefox?

Topics: ASP.NET 2.0, Controls, Themes
Nov 24, 2008 at 2:59 PM
Edited Nov 24, 2008 at 3:05 PM
When browse in Firefox, it seems that when i click to view one post, the post following it also be requested(found via debugging in vs2005)? 
I add a view counter property to Post object, when click one post in Firefox, the counter of the post following it is also increased. 
Thanks in advance.
BTW: I've made an enhanced version for our team, add some new features as Dual-Language posts support, New paging control, Post view counter(Non-Extension solution)...
welcome to if you have interest in them -:).
if you can not reach this site, please let me know(mail-to:, replace # with @), thanks a lot!
Jan 31, 2009 at 9:27 AM
In confirm that : the event is fired once for the displayed post and once for the next post, though the next post is not actually displayed.

Workaround :

        // The event is sometimes called many times for the same SinglePost view
        // or once for current post and once for the next post.
        // If we already counted that view, give up
        string servingKey = userHost + ((Post)sender).AbsoluteLink;
        if (servingKey == _lastServingKey || servingKey == _lastServingNextKey)
        _lastServingKey = servingKey;
        if (((Post)sender).Next != null)
            _lastServingNextKey = userHost + ((Post)sender).Next.AbsoluteLink;
            _lastServingNextKey = null;