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. 3 5620
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.getElementById('screenX')=window.screen.w idth;
document.getElementById('screenY')=window.screen.h eight;
</script>
-- bruce (sqlwork.com)
"Chris" <Ch***@discussions.microsoft.com> wrote in message
news:A2**********************************@microsof t.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.
|
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***@discussions.microsoft.com> a écrit dans le message de
news:A2**********************************@microsof t.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.
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***@discussions.microsoft.com> wrote in message
news:A2**********************************@microsof t.com... Problem: I would like to detect, get values for, the screen resolution in px but in a code behind. Is this possible? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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)...
|
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 =...
|
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....
|
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...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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...
|
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,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
| |