By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,118 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

screen resolution detection

P: n/a
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.
Jul 21 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Chris <Ch***@discussions.microsoft.com> wrote:
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?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2

P: n/a
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.
"Jon Skeet [C# MVP]" wrote:
Chris <Ch***@discussions.microsoft.com> wrote:
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?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Jul 21 '05 #3

P: n/a
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

--

"Chris" <Ch***@discussions.microsoft.com> a écrit dans le message de
news:29**********************************@microsof t.com...
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.
"Jon Skeet [C# MVP]" wrote:
Chris <Ch***@discussions.microsoft.com> wrote:
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?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Jul 21 '05 #4

P: n/a
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.

"Patrice" wrote:
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

--

"Chris" <Ch***@discussions.microsoft.com> a écrit dans le message de
news:29**********************************@microsof t.com...
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.
"Jon Skeet [C# MVP]" wrote:
Chris <Ch***@discussions.microsoft.com> wrote:
> 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?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


Jul 21 '05 #5

P: n/a
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

--

"Chris" <Ch***@discussions.microsoft.com> a écrit dans le message de
news:63**********************************@microsof t.com...
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.

"Patrice" wrote:
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

--

"Chris" <Ch***@discussions.microsoft.com> a écrit dans le message de
news:29**********************************@microsof t.com...
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.

"Jon Skeet [C# MVP]" wrote:

> Chris <Ch***@discussions.microsoft.com> wrote:
> > 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?
>
> --
> Jon Skeet - <sk***@pobox.com>
> http://www.pobox.com/~skeet
> If replying to the group, please do not mail me too
>


Jul 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.