Visual Studio .NET - Hide address bar of current webpage browser

Asked By Vasundhara Ravikanti on 20-Nov-08 05:09 AM

Hi,

I need to hide the address bar of the current webpage


read this - C_A P replied to Vasundhara Ravikanti on 20-Nov-08 05:42 AM

You can either use a system called URL Rewriting, or you can load your web page in an IFrame, contained at a page hosted at the URL that you'd like to show, it will never change at that point, as the user navigates through the page contained in the iframe.

If it's just one page, then rename the WebPage1.aspx file over to Default.aspx and it will become the default document for IIS. So then http//localhost/TestApplication/  will work. You could change your IIS settings so WebPage1.aspx becomes a default document type, but I would recommend just renaming the document.

URL rewriting in asp.net can be found at http://msdn2.microsoft.com/en-us/library/ms972974.aspx

java script to hide address bar of current webpage browser - C_A P replied to Vasundhara Ravikanti on 20-Nov-08 05:44 AM

you can hide the window bar and the standard buttons within a popup

This in your head:

<script language="javascript" type="text/javascript">
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}
// -->
</script>


This in your body:

<a href="http://www.mydomain.com%22/ onclick="NewWindow(this.href,'newwindow','450','750','yes','center');return false" onfocus="this.blur()">YourLinkText</a>

Re :: Hide Addressbar of current webpage browser - SP replied to Vasundhara Ravikanti on 20-Nov-08 05:55 AM

See the following article to show/Hide the addressbar of current web browser.

http://www.microsoft.com/windows/ie/community/columns/securityupgrade.mspx

Hope this helps.

Hide address bar of current webpage browser - mv ark replied to Vasundhara Ravikanti on 20-Nov-08 05:55 AM
Specifying location=no in the last parameter of window.open method will hide the addressbar
window.open("Sample.htm",null,
"height=200,width=400,status=yes,location=no");


For more info, check this link - http://msdn.microsoft.com/en-us/library/ms536651(VS.85).aspx
re - Web Star replied to Vasundhara Ravikanti on 20-Nov-08 06:33 AM

in javascript u can use addressbar=no for hide address bar

but in your senario u need to current webpage without address bar

then u just open current page with this propery

window.open('" + strPageName + "', '', 'addressbar=no, scrollbars =no, resizable=yes,status=yes, fullscreen=yes,location=yes, toolbar=yes, menubar=yes,top = 0, left = 0, target=_self');

Reply - Binny ch replied to Vasundhara Ravikanti on 20-Nov-08 11:19 AM

 Here's a mimic version that should create the desired effect:

<script type='text/javascript'>
<!--
  if(document.location.search != "")  {
    obj = document.location.search.substr(document.location.search.indexOf('?') + 1)
    address = (obj=="true") ? true : false ;
  } else {
    address=true
  }


  function toggleAddress(isvis)  {

    add = (address) ? "no" : "yes" ;

    if(isvis != "")  {
      add = isvis
    }
    q = (add=="yes") ? false : true ;
    if(q) {
      address=false
    } else {
      address=true
    }

    window.open("test5.html?" + address,"", "toolbar=" + add + ",location=" + add + ",status=" + add + "menubar=" + add +

"scrollbars=" + add);

    self.opener = ""
    self.close()
  }

//-->
</script>
<a onClick='toggleAddress("")'>Toggle</a>||<a onClick='toggleAddress("yes")'>With Address</a>||<a onClick='toggleAddress("no")'>No Address</a>

Reply - Binny ch replied to Vasundhara Ravikanti on 20-Nov-08 11:20 AM

I don't know if you can make your page do this as soon as it come up, but you can hide the window bar and the standard buttons within a popup

This in your head:

<script language="javascript" type="text/javascript">
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos)

{
if(pos=="random")

{

LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;

TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;

}
if(pos=="center")

{

LeftPosition=(screen.width)?(screen.width-w)/2:100;

TopPosition=(screen.height)?(screen.height-h)/2:100;

}
else if((pos!="center" && pos!="random") || pos==null)

{

LeftPosition=0;

TopPosition=20

}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);

}
// -->
</script>


This in your body:

<a href="http://www.mydomain.com" onclick="NewWindow(this.href,'newwindow','450','750','yes','center');return false" onfocus="this.blur()">YourLinkText</a>