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

Discussion in 'ASP .Net' started by moondaddy, May 18, 2007.

  1. moondaddy

    moondaddy Guest

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

    Thanks.

    --
    am
    moondaddy, May 18, 2007
    #1
    1. Advertising

  2. 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 (, 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.
    Walter Wang [MSFT], May 18, 2007
    #2
    1. Advertising

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


    Regards,
    Walter Wang (, 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.
    Walter Wang [MSFT], May 23, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page