page size...

Discussion in 'ASP .Net Web Controls' started by Jim, Oct 16, 2003.

  1. Jim

    Jim Guest

    I have a pop window that is displayed and depending on the state of the
    system it will contain any number of user controls(ascx). These controls
    contain dynamic content and therefore the size of the control can change
    dynamically.

    Is it possible to work out the size of the page that is going to be
    displayed from the code behind page and then resize the pop window
    accordingly?

    Cheers

    Earth Worm Jim
     
    Jim, Oct 16, 2003
    #1
    1. Advertising

  2. Ouch sorry. Didn't see...

    "Jim" <ssss> wrote in message news:...
    > I have a pop window that is displayed and depending on the state of the
    > system it will contain any number of user controls(ascx). These controls
    > contain dynamic content and therefore the size of the control can change
    > dynamically.
    >
    > Is it possible to work out the size of the page that is going to be
    > displayed from the code behind page and then resize the pop window
    > accordingly?
    >
    > Cheers
    >
    > Earth Worm Jim
    >
    >
    >
     
    Patrick Dahmen, Oct 16, 2003
    #2
    1. Advertising

  3. Yes I think it is.

    I IE you could generally use getBoundingRect() function to retrieve the size of your controls, even if they have no constant size (width or height params within style element)

    for example
    <script>
    function changeWindowSize()
    {
    var oSizingControl = document.getElementById('sizingControl');
    width = oSizingControl.getBoundingClientRect().right - oSizingControl.getBoundingClientRect().left;
    height = oSizingControl.getBoundingClientRect().bottom - oSizingControl.getBoundingClientRect().top;

    window.resizeTo(width + 25, height + 50);

    }
    </script>
    <body onload="changeWindowSize()">
    <asp:Label runat="server" id="sizingControl">Here is my text, i don't know the width and height of</asp:Label>

    </body>

    I hope that helped...

    "Jim" <ssss> wrote in message news:...
    > I have a pop window that is displayed and depending on the state of the
    > system it will contain any number of user controls(ascx). These controls
    > contain dynamic content and therefore the size of the control can change
    > dynamically.
    >
    > Is it possible to work out the size of the page that is going to be
    > displayed from the code behind page and then resize the pop window
    > accordingly?
    >
    > Cheers
    >
    > Earth Worm Jim
    >
    >
    >
     
    Patrick Dahmen, Oct 16, 2003
    #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.
Similar Threads
  1. Madhanmohan S
    Replies:
    5
    Views:
    7,820
    Madhanmohan S
    Sep 3, 2004
  2. Andreas Klemt
    Replies:
    6
    Views:
    11,319
    Peter Theill
    Nov 28, 2004
  3. =?Utf-8?B?QmlkYXJrb3Rh?=

    How to set the DataGrid Row Size to a fixed size.

    =?Utf-8?B?QmlkYXJrb3Rh?=, May 19, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    848
    =?Utf-8?B?QmlkYXJrb3Rh?=
    May 19, 2005
  4. lazy

    string size greater than page size?

    lazy, Apr 27, 2007, in forum: C Programming
    Replies:
    3
    Views:
    381
    Army1987
    Apr 27, 2007
  5. Jason Cavett

    Preferred Size, Minimum Size, Size

    Jason Cavett, May 23, 2008, in forum: Java
    Replies:
    5
    Views:
    12,705
    Michael Jung
    May 25, 2008
Loading...

Share This Page