-1

How to hide address bar in mvc web application? I want to hide that in every view. I have tried by doing this code in javascript:

function popup(pageURL, title, popupWidth, popupHeight) {
    window.moveTo(0, 0);                

    var targetPop = window.open(pageURL, title, 'status=no, tmenubar=no, scrollbars=yes, maximize=yes, resizable=no, width=' + screen.availWidth + ',height=' + screen.availHeight, "_blank");
    targetPop.moveTo(0, 0);
    targetPop.focus();
}

i call that function on _Layout :

<body onload="popup()">
</body>

i don't know how to get current url to pass it to the "pageURL" parameter. or do i do that in a wrong way?

can you guys give me better solutions?

EDITED:

when first time i run the app, it will show the main _Layout and the Index view inside (Renderbody()). how i make the main layout to hide the address bar? and so if i navigate to another view

Thank You guys. Sorry for My bad English.

Lee Taylor
  • 7,761
  • 16
  • 33
  • 49
TeachMe
  • 1
  • 4

1 Answers1

0

Here you go try this

<body onload="popup(window.location.href, 'New Window', 500, 500)">
</body>

To hide address bar its more to tricky way depends on your browser because very browser have different method. Maybe you want to see this : Hiding the address bar of a browser

Community
  • 1
  • 1
aswzen
  • 1,512
  • 29
  • 46