Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8838203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:55:50+00:00 2026-06-14T09:55:50+00:00

Ok, so I am trying to have a static menu on the left side

  • 0

Ok, so I am trying to have a static menu on the left side of the page so that it doesn’t change when click on a link.

How I am doing this is I call a little javascript on my A tag that calls some ajax. My controller returns a Partial View which then is loaded into my content div.

This all works fine. What I am having trouble with is that my URL isn’t changing and I would like to be able to use the back button to go back to a previous page.

I have tried to use location.hash but that doesn’t seem to work in the way that I hoped. Thoughts?

Below is my code.

HTML

<li class="item3"><a href="#">Admin</a>
<ul>
    <li class="subitem1"><a onclick="ChangePage('/Admin/PageName', 'Hash')">Page Name</a></li>

Javascript

function ChangePage(path, hash) {
        $.post(path, function (data) {
            $('#content').html(data);
            window.location.hash = '#' + hash;
        });
    }

Controller

 public ActionResult PageName()
    {
        return PartialView("MyPage");
    }

Thanks!
David

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T09:55:52+00:00Added an answer on June 14, 2026 at 9:55 am

    Consider checking out pjax. It’s very easy to implement w/ MVC, and will do exactly what you’re trying to accomplish.

    This article talks about another option, PAjax.

    Both leverage pushState, which as you stated in the comments, is still not fully supported by all browers. But pjax does gracefully degrade by doing a full page update when pushstate is not supported.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UITableView with static cells and I am trying to change the
I have a static library that I have built with MinGW, I am trying
I have a page design I'm trying to implement with a header (menu bar)
i have to get static information from one 'module' to another. I'm trying to
I have the latest Qt SDK. I'm trying to configure it for static building
I am trying to have a table like this: Manager Expert Adminis. Staff Dept
I am trying to have a method that takes in a username and will
I am trying to use the code in this article that lets you know
So, for some hours now, I have been trying to do something that I
I am trying to create a menu in the console and have the user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.