473,466 Members | 1,301 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

screen resolution detection

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
5 4383
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: VJ | last post by:
Is there a any known easy way to fit web pages for a screen resolution. Can I do this programmatically? VJ
3
by: Chris | last post by:
I think I placed this in the wrong news group so I'm moving it here. Suggestion to Microsoft make the categories more clear and make better sense. ASP.NET should be its own group, why bury under...
1
by: GMK | last post by:
Hi all i would like to know how could i let my application to auto detect the clients screen resolution and to fit my application design on the spesification of the clients screen is there any...
7
by: Bredahl jensen | last post by:
Most of the the solution i have seen was throught javascript. Many thanks in advance JB
5
by: Chris | last post by:
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:...
5
by: Maxi | last post by:
I have a 30X16 cells table in my html page. Table height and width are set to 100%. I have set size of every cell inside the table to 24 pixel. When I open the html page in maximize state in...
9
by: Steve Wright | last post by:
Hi I'm developing a webpage that needs to include a different stylesheet depending on the screen resolution. I know that I could read the resolution in javascript and then do some sort of...
1
by: nasima khan | last post by:
Hi, i am nasima. I have got a code for setting the screen resolution of my page, but i am unable to understand. Can any one give a complete data explanation of the below code. Sub ChangeRes(X...
10
by: =?Utf-8?B?UmljaA==?= | last post by:
A lot of users at my workplace use different screen resolutions, and I build apps to use 1680 x 1050 pixels res by default. But some users are using 800 x 600, and the apps are too large for their...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.