#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Location
    127.0.0.1
    Posts
    448
    Rep Power
    13

    Partial Postback with URL change


    Hello,

    I am looking for a solution to do a partial postback, but also update the URL at the same time. This way, I can keep a state of what the user is looking at and be able to recreate it if they desire to copy paste the link to another user.

    I believe this is how Facebook operates using a #! in their address bar. For an example, open any photo album and start clicking through the album quickly and it seems to be a partial postback with URL changes.

    Any links to read on about this or what it is called?
    John5788
  2. #2
  3. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,179
    Rep Power
    9398
    The stuff after the # is called the fragment, or anchor, or one of a handful of other terms. I think "fragment" is the official one.

    You can do an AJAX postback and update the document.location.fragment (or is it .anchor? argh) at the same time. But it means that you'll need to use JavaScript (or .NET client-side) to detect that value when the page first loads - .NET server-side can't get it directly.
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Location
    127.0.0.1
    Posts
    448
    Rep Power
    13
    Originally Posted by requinix
    The stuff after the # is called the fragment, or anchor, or one of a handful of other terms. I think "fragment" is the official one.

    You can do an AJAX postback and update the document.location.fragment (or is it .anchor? argh) at the same time. But it means that you'll need to use JavaScript (or .NET client-side) to detect that value when the page first loads - .NET server-side can't get it directly.
    ah ok. I looked into it more and it looks like it is document.location.hash actually. thanks
    John5788
  6. #4
  7. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,179
    Rep Power
    9398

IMN logo majestic logo threadwatch logo seochat tools logo