[Webinar] Learn how to a build a cloud-first strategyRegister Now


controlling window size in WebForms

Posted on 2011-10-23
Medium Priority
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() {

        ButtonReturn.style.visibility = "hidden";
        TextURL2Grid.style.visibility = "hidden";
        TextGridHeight.style.visibility = "hidden";
        TextGridWidth.style.visibility = "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 window.open() 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
  • 2
LVL 83

Accepted Solution

CodeCruiser earned 2000 total points
ID: 37016720

Author Comment

ID: 37022439
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

ID: 37023175
>sOptions = 'status=yes,menubar=yes,scrollbars=yes,resizable=yes,toolbar=yes'

Try playing with the location attribute


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

865 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