473,599 Members | 3,227 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

client screen size and MS suggestion

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 Framework. And I see
others doing the same mis-posting to dotnet.general which appears to be
gearded more towards windows applications. What are General and Framework for
options under .NET Development!

After exhausting my search on the MS website, I can't find a straight answer.
I find it 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.

Nov 18 '05 #1
3 5641
the easy answer is the browser does not send the client screen resolution
and the server code has no access to the client machine. you can write
javascript to capture it, and post the values with a sniffer page (usually
the entry page of the site). while you can control general layout this way,
there is no way for the server to know the size of strings in pixels,
because it will not know the fonts/sizes actually used by the client
browser. also the size of the browser window is more important than the
screen resolution, and the user can easily change this.

add this to every page, and you can know the resolution on every postback.
(save it in session for GET renders)

<input type=hidden name=screenX id=screenX runat=server>
<input type=hidden name=screenY id=screenY runat=server>
<script>
document.getEle mentById('scree nX')=window.scr een.width;
document.getEle mentById('scree nY')=window.scr een.height;
</script>

-- bruce (sqlwork.com)
"Chris" <Ch***@discussi ons.microsoft.c om> wrote in message
news:A2******** *************** ***********@mic rosoft.com...
| 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 Framework. And I
see
| others doing the same mis-posting to dotnet.general which appears to be
| gearded more towards windows applications. What are General and Framework
for
| options under .NET Development!
|
| After exhausting my search on the MS website, I can't find a straight
answer.
| I find it 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.
|
Nov 18 '05 #2
Please avoid to create multiple threads for the same subject.

Keep in mind that ASP.NET is all about server side. There is no HTTP/HTML
mecanism that automagically sends this info to the server. You'll have to
use js to find out those values and post it yourself.

The whole story may also help (if this is to position elements, you may want
to see if HTML doesn't allow to "autoplace" those element such as just by
centering)

Patrice

--

"Chris" <Ch***@discussi ons.microsoft.c om> a écrit dans le message de
news:A2******** *************** ***********@mic rosoft.com...
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 Framework. And I see others doing the same mis-posting to dotnet.general which appears to be
gearded more towards windows applications. What are General and Framework for options under .NET Development!

After exhausting my search on the MS website, I can't find a straight answer. I find it 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.

Nov 18 '05 #3
Hi Chris,

There are tricks to get client-side information back to the server but it
requires a postback.

If you check out this page and its control, you'll see that the size of the
window is returned:

http://www.metabuilders.com/Tools/ResizeMonitor.aspx

Ken

"Chris" <Ch***@discussi ons.microsoft.c om> wrote in message
news:A2******** *************** ***********@mic rosoft.com...

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


Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2392
by: chuck amadi | last post by:
By the way list is there a better way than using the readlines() to > > >parse the mail data into a file , because Im using > > >email.message_from_file it returns > > >all the data i.e reads one entire line from the file , headers as well > > >as just the desired body messages . > > > > > >fp = file("/home/chuck/pythonScript/testbox") > > >mb = mailbox.UnixMailbox(fp, > > >email.message_from_file)
1
3165
by: Frank | last post by:
Hi, we are using oracle clients (Release 9.0.1.0.1 - Production) on an NT4 (Service Pack6) computers. the server is a W2K, (Oracle9i Enterprise Edition Release 9.0.1.1.1 - Production With the Partitioning option,JServer Release 9.0.1.1.1 - Production) machine. now we are going to update several of those client boxes to a dual processor board. - great thinking but they are randomly crashing to blues screen. okay it is ms but the old...
15
4464
by: Michael Rybak | last post by:
hi, everyone. I'm writing a 2-players game that should support network mode. I'm now testing it on 1 PC since I don't have 2. I directly use sockets, and both client and server do computations, the only data transfered is user mouse/kbd input. It works synchronously, but somehow, when I play in client window, both client and server have 17 fps, while when playing in server window, server has 44 fps while client ...
5
1864
by: Joe Bonavita | last post by:
My Web forms display differently on different machine with the same resolution. The pages are designed to fit in 800*600 res but on some machines with 800*600 the form appears too big. Are there any built in functions to adjust the form based on resolution? Is there a way to detect the clients resolution? 1 last one, when using an image, how do I get the image to stay proportionate when reduced? Thanks,
1
1237
by: al | last post by:
Greetings, How should I adjust my text size on my 21(inch) screen so it looks nicely fit on client's 17(inch), all are with IE 6? I use 'Larger' text size but it appears large on client's and affecting the overall look of the aspx page. MTIA, Grawsha
4
5392
by: Abubakar | last post by:
Hi, I am writing a server in C# and client in C++ (pure, not managed). The communication goes on through sockets. In C# I am using NetworkStream to send text data (by converting it to byte array) to the c++ client. In c++ client I have "recv" (winsock) function through which I receive everything. Now there is a need to pass a "struct" of C# through the "write" function of network stream. I want to know how this can be done. Also I would...
4
11769
by: active | last post by:
I've been looking for a way to determine the DPI (PPI) of the screen. I've found often the suggestion to use: Dim height As Integer = My.Computer.Screen.Bounds.Height Dim width As Integer = My.Computer.Screen.Bounds.Width but that gives the total number of pixels not the DPI (which is usually 96 for pc's).
3
2865
by: Francois | last post by:
I have dynamic controls, and I want to change the display accoring to the client browser resolution. I have tried browser capabilites, but I did not get size. How could I do it ? Thanks. François.
0
8919
by: raylopez99 | last post by:
keywords: logical coordinates, page coordinates, world coordinates, device coordinates, physical coordinates, screen coordinates, client coordinates. offset rectangle. WYSIWYG rubber rectangle problem, bounded rectangle problem. PointToClient, PointToScreen Beware this newbie trap for the unwary. It goes by various names (in some old MFC literature I saw some of the keywords above). Whenever doing comparisons between points,...
0
7993
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8404
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8053
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6729
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5866
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5440
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3944
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1508
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1252
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.