Using a physical URL in the location.href will always reload the page. If you want to jump into another part of the page you need to use the hash anchors on their own:
location.href="#bookmark";
This should not reload the page.
If you have an anchor in the page you can also do:
document.getElementById("YourAnchor").focus();
assuming the anchor has an ID.
+++ Rick ---
>Hi all,
>
>I have a javascript running whenver the form's onunload event fires. The javascript will popup a confirm box to ask user whether to stay at the current page or redirect to somewhere else.
>
>Howoever, when I use " window.location.href = window.location.href ", the page will be reloaded, which some changed values on the form will be missing. Therefore, I added a hash, window.location.href = window.location.href + "#", but it's not working. I have tested with " __doPostBack('__Page', '') ", but somehow it's not working in some forms. Is there a way to stay at the page without reloding the page? Thanks.
>
>Here is my javascript:
>
>
>function onPageUnload()
>{
> var result = confirm("Do you want to leave the page?")
> if (result)
> window.location.href = window.location.href
> else
> windwo.location.href = "./Logout.aspx"
>}
>