Coffeehouse Thread

5 posts

Channel 9 bug?

Back to Forum: Coffeehouse
  • User profile image
    Manip

    I have noticed this odd bug .. ok find a long thread, one with multiple pages and from the main thread listing (like the 'Coffeehouse') click the [3] link which SHOULD take you to the third page. Instead it seems to tell you that your on the third page but display the posts from the first page! Even the [1] [2] [3] at the bottom of the page it takes you to tells you your on the third page.. the only way to ACTUALLY see the third page is to click [1] (which refreshes the page) and then click [3] (from within the thread) which ACTUALLY takes you to the third page.

    Look at "How to easily make Windows free: Idea?" for an example.

  • User profile image
    GooberDLX

    It was introduced when they decide to start putting in Permalinks! The have the thread number and post number, but not the correct "page" of the thread.
     
    It would be tough to calculate position considering post IDs are not relative to Thread ID or the number of posts in a thread..

    Jake

  • User profile image
    Charles

    We will look into this. Not a bad hypothesis, GooberDLX.

    Keep on posting,

    Charles

  • User profile image
    Bryn Waibel

    GooberDLX wrote:
    It was introduced when they decide to start putting in Permalinks!


    Yep, that's exactly when it started.

    GooberDLX wrote:
    The have the thread number and post number, but not the correct "page" of the thread.


    Actually, if the permalinks had a page number in them, they wouldn't be permalinks.  What if we decided to change the default number of posts on a single page? Permalinks are "supposed" to never break, and by only putting the postid into the link, we are able to figure out which page a given post falls on at any given time.
     
    GooberDLX wrote:
    It would be tough to calculate position considering post IDs are not relative to Thread ID or the number of posts in a thread..


    Tough? Well, not simple, but also not overly complex. The ASP.Net forums uses temporary tables with an auto incrementing identity to do it's paging rather than a cursor or some other mechanism. What this means is that all of the results are loaded into an in memory table with consecutive indices. The query that actually returns results uses the pageIndex to define an upper and lower bound for the index value. All I did was pass in -1 as the page index when the page was not previously defined. In SQL, if the pageIndex is -1, we can find it from the temporary table by selecting the index from the post id that we're looking for and dividing it by the size of the page.

    The problem that you all noticed was that my base condition was invalid. I was using Page.IsPostBack to determine if the page was already defined and passing in -1 otherwise. This effectively served to ignore the value that was passed into the query string, even though it still set the value on the little pager control, which resulted in the behavior that you were seeing. I've fixed that little bug and now you should have the best of both worlds.

    Enjoy
    -Bryn

  • User profile image
    GooberDLX

    Bryn Waibel wrote:
    GooberDLX wrote: It was introduced when they decide to start putting in Permalinks!


    Yep, that's exactly when it started.




    SCORE! Smiley +1

    Yeah Im not aware of the backend processing of ASP.Net Forums, so it was only a hypothesis.. glad to know more about the innerworkings...

    Thanks for the fix!
    Jake

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.