controlling window size in WebForms

Posted on 2011-10-23
Last Modified: 2012-06-21
When the application starts, the user is presented with
a list of applicants on a grid, then clicks the "Edit"
button on a row to begin processing the chosen applicant in a new window.

When the applicant is approved, an html approval letter
is invoked (loaded into the browser) which includes a "Print" button (called ButtonReturn here) at the bottom.

The Print button invokes the following javascript

function ButtonReturn_onclick() {
 = "hidden"; = "hidden"; = "hidden"; = "hidden";

        var newwin;
        var vurl;
        var nextwin;
        var nextwidth;
        var nextheight;

        nextwidth = TextGridWidth.value;
        nextheight = TextGridHeight.value;

        vurl = TextURL2Grid.value;




Open in new window

My goal is to return to the Grid window after the approval letter is printed and restore it in the same size and position as I left it (maximized), but for some reason the javascript above opens the  window with the Maximize button disabled.

Also, while I have a way to tell the client the width and height numbers from the grid window, I have been unsuccessful in finding the right combination to send to the client.  I have tried Request.Browser.ScreenCharactersHeight and Request.Browser.ScreenPixelsHeight, but neither have achieved the effect for which I am searching when sent to the javascript function. (The window should look as if the user clicked the maximize button.)

I am using IE.  This is for an intranet application, so I can be assured my users will be using IE as well.

Can anyone help me overcome these problems?

Thanks in advance!
Question by:codefinger
    LVL 83

    Accepted Solution


    Author Comment

    Pretty good CodeCruiser, but for some reason the address bar disappears from the browser.

    I can live with that, but only if here is not way to avoid it...

    LVL 83

    Expert Comment

    >sOptions = 'status=yes,menubar=yes,scrollbars=yes,resizable=yes,toolbar=yes'

    Try playing with the location attribute

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
    In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
    In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now