tags:

views:

116

answers:

1

I am needing to get the browser height and width of the browser window with vb. I can get these values by setting an ASP.Net hidden input control using javascript, after the page has loaded and a post back is done. I need to be able to get these values when the page initially loads so I can create an image based on those values.

I am still new at VB.Net, so any help would be great. Thanks!

+1  A: 

Quick answer: No, you cannot.

BUT: You may have access to those values by looking at the request headers values.

Please note that the value may not always be there and that different browser may or may not sent those values with different keys.

The best way to have this value should be usign javascript or vbscript (ie CLIENT script). You may use ajax you create your image async way.

ASP.NET is a SERVER side programming language (like JSP or PHP) and has nothing to do with which browser access it...

Look at it this way, what is the screen size of Google Bot "browser" ? Or what if a access your site with telnet ?

So you should use client script to have acces to client properties.

Do not hesitate to comment if I am not clear or right.

Developer IT
That makes sense, I guess I am hoping that there is some kind of magic function I can call that would just give me the value I want.
Barlow Tucker
No... sadly the web was not origialy design to be user friendly... remember that http stands for hyperTEXT transfert protocol. So usign telnet to browse is ok too.Try to use jQuery with a async ajax call to an wcf service to get your image
Developer IT