0

Is there any way to retain or pass the hash value of a url to the server using Url.Referrer

For example, I have a view with 3 bootstrap tabs (tab1, tab2 and tab3), when a user clicks on a tab, it hashes the URL, thus if someone types the url directly we set the correct tab.

This is how a url looks like

https://localhost:8080/myitems#tab2

This is the jquery code to hash and scroll to the tab

var hash = window.location.hash;
hash && $('ul.nav a[href="' + hash + '"]').tab('show');

$('.nav-tabs a').click(function(e) {
    $(this).tab('show');
    var scrollmem = $('body').scrollTop();
    window.location.hash = this.hash;
    $('html, body').scrollTop(scrollmem);
});

The problem is, in one of the tab, it has an edit link that opens a new page, in the new page it has a go back button using URL.Referrer. If I mouse over on the link, I doesn't show the hash part of the URL.

So, my question is, is there any way it can send or retain the hash value to the server?

Thanks,

1 Answer 1

1

No... hash is not sent so server and is only used by the browser.

There is no way to intercept that.

I don't quite understand your tab link logic and suspect you will need to change the way you manage that link.

Perhaps you could use a cookie or localStorage and javascript to manage it

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.