Is it possible to determine the screen size of the web client, as well as the screen size of the browser in server-side code? I know in client side code, you would use screen.availwidth, screen.availheight, ... etc to obtain this information, but is it available
to server side code? Thanks, Andrew
Any value that is available to you on the client side can be made available to the server by writing it to a form element (usually a hidden input) before the submit. document.forms[0].screenheight.value=screen.availheight; <form runat=server> <input type=hidden
id=screenheight runat=server> </form>
Thanks so much, but I want to know if the ability is built into dot.net so that I don't have to place the code on the client side first and wait for a postback. Andrew
HTTP Get requests do not include the size of the screen nor the size of the browser. There is nothing that any serverside technology can ever do to change that. You could emit some script that performs an immediate postback whenever you don't know the sizes.
This way you could be assured of knowing this information, in the case that the browser supports script at all. If the browser doesn't support script, you will never know its size information. Most people who want this information, are using it to "reflow"
their grid/absolute positioning based form designs. I would suggest you stop using grid based designs, and switch to flow based layout, as HTML is intended to be used.
andrew@softw...
Member
195 Points
39 Posts
Browser and Screen Size in server side code
Jul 31, 2003 08:13 PM|LINK
Software Factory
rl711
Participant
825 Points
165 Posts
Re: Browser and Screen Size in server side code
Jul 31, 2003 08:28 PM|LINK
Andy Smith
Participant
1910 Points
380 Posts
ASPInsiders
Re: Browser and Screen Size in server side code
Aug 01, 2003 12:10 AM|LINK
andrew@softw...
Member
195 Points
39 Posts
Re: Browser and Screen Size in server side code
Aug 01, 2003 02:52 PM|LINK
Software Factory
Andy Smith
Participant
1910 Points
380 Posts
ASPInsiders
Re: Browser and Screen Size in server side code
Aug 01, 2003 05:39 PM|LINK