screen resolution detection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

After exhausting my search on the MS website, I can't find a straight answer.
I fin dit hard to believe that MS left our something so useful in ASP.NET as
screen resolution detection.

Problem:
I would like to detect, get values for, the screen resolution in px but in a
code behind. Is this possible?

There is a System.Windows.Forms.Screen class for the Windows client side,
why are there none for browser/ASP.NET client?

thank you.
 
Chris said:
After exhausting my search on the MS website, I can't find a straight answer.
I fin dit hard to believe that MS left our something so useful in ASP.NET as
screen resolution detection.

Problem:
I would like to detect, get values for, the screen resolution in px but in a
code behind. Is this possible?

There is a System.Windows.Forms.Screen class for the Windows client side,
why are there none for browser/ASP.NET client?

Because browsers don't generally (AFAIK) pass the screen resolution in
requests?
 
So we are reduced to client side Javascript. Can those values be accessible
via the ASPX page code behind? I use VB.

I know that products like Browser Hawk access them and make available that
information via their objects. So there must be a better way to do this.
 
You could get the value client side using js and pass the value as an hidden
field.

Do you want to use this value for something else than statistics ?

Patrice
 
pass via hidden field? Using to update the attribute of a button to open a
new window (page) in a certain size based on user screen resolution. I've
found that the Javascript window.open uses only pixels and that I'd rather
use percent % since screen resolution has not been determined but JavaScript
window.open does not allow that.
 
If you really need you could likely open the window with whatever size you
want and resize the window once opened. This way you won't need this info
server side. I believe we have done this once.

Patrice

--
 
Back
Top