How to remove menu/tool bars and fix size of page


M

moondaddy

How can I remove all menu and toolbars from a web page (aspx) and fix the
size of the page?

Thanks.
 
Ad

Advertisements

W

Walter Wang [MSFT]

Hi moondaddy,

This have to be done at client-side using javascript. Please try following
test to see if it helps for your requirement:

1) Create a simple html file named 'close.htm' with following content:

<html><body>
<script language="JavaScript">window.close();</script>
</body></html>

This is to workaround the prompt when closing the current window using
javascript. I found this workaround here:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=962189&SiteID=1

2) In your default.aspx.cs:

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack && Request.QueryString["open"] != "1")
{
ClientScript.RegisterStartupScript(GetType(), "open",
"window.open('close.htm', '_self'); window.open('Default.aspx?open=1',
'_blank', 'height=640, width=480, menubar=no, toolbar=no')", true);
}
}


This will re-open default.aspx within a popup window that has removed the
menubar and toolbar.

#open Method (window)
http://msdn2.microsoft.com/en-us/library/ms536651.aspx


Hope this helps.


Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Ad

Advertisements

W

Walter Wang [MSFT]

Please feel free to let me know if there's anything else I can help.


Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Top