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.
 
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.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top