Re: What size is my page?

Discussion in 'ASP .Net' started by Sabre, Jul 2, 2003.

  1. Sabre

    Sabre Guest

    You could try this with js ...

    In html page HEADER, something like ...

    <script language="Javascript">
    <!--
    function displayRes()
    {
    document.Form1.scrWidth.value = window.screen.width;
    document.Form1.scrHeight.value = window.screen.height;
    }
    -->
    </script>
    </HEAD>
    <body bgColor="#ffefd5" onload="displayRes();" ms_positioning="GridLayout">

    onload="displayRes();" calls the function. On your aspx you could do ...
    Session("ScreenWidthpx") = scrWidth.Value

    Session("ScreenHeightpx") = scrHeight.Value

    or whatever.

    Hope this helps
    Graeme


    "Fiona" <> wrote in message
    news:047201c3403e$7eb9c640$...
    > I need to know the dimensions of my page when it is
    > loaded/reloaded, so that I can resize a panel displayed
    > inside it accordingly. However I am unable to find any
    > properties which will tell me this.
    >
    > Could anyone tell me how to find out the height and width
    > of my page, and whether there is an event related to page
    > resizing which I can catch? If it matters, I'm using c#.
    >
    > Thanks in advance.
    Sabre, Jul 2, 2003
    #1
    1. Advertising

  2. Sabre

    Chris Becker Guest

    Take a gander at this tool on MetaBuilders:

    http://www.metabuilders.com/Tools/ResizeMonitor.aspx

    Just remember that you will not know the size of the window until the page
    loads and posts back! You cannot know the size of the window on the first
    request.

    "Sabre" <> wrote in message
    news:...
    > You could try this with js ...
    >
    > In html page HEADER, something like ...
    >
    > <script language="Javascript">
    > <!--
    > function displayRes()
    > {
    > document.Form1.scrWidth.value = window.screen.width;
    > document.Form1.scrHeight.value = window.screen.height;
    > }
    > -->
    > </script>
    > </HEAD>
    > <body bgColor="#ffefd5" onload="displayRes();"

    ms_positioning="GridLayout">
    >
    > onload="displayRes();" calls the function. On your aspx you could do ...
    > Session("ScreenWidthpx") = scrWidth.Value
    >
    > Session("ScreenHeightpx") = scrHeight.Value
    >
    > or whatever.
    >
    > Hope this helps
    > Graeme
    >
    >
    > "Fiona" <> wrote in message
    > news:047201c3403e$7eb9c640$...
    > > I need to know the dimensions of my page when it is
    > > loaded/reloaded, so that I can resize a panel displayed
    > > inside it accordingly. However I am unable to find any
    > > properties which will tell me this.
    > >
    > > Could anyone tell me how to find out the height and width
    > > of my page, and whether there is an event related to page
    > > resizing which I can catch? If it matters, I'm using c#.
    > >
    > > Thanks in advance.

    >
    >
    Chris Becker, Jul 2, 2003
    #2
    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,707
    Madhanmohan S
    Sep 3, 2004
  2. Andreas Klemt
    Replies:
    6
    Views:
    10,996
    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:
    812
    =?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:
    348
    Army1987
    Apr 27, 2007
  5. Jason Cavett

    Preferred Size, Minimum Size, Size

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

Share This Page