?
Solved

Getting Browser Window Size for ASP.NET server side code

Posted on 2009-07-01
5
Medium Priority
?
1,371 Views
Last Modified: 2012-05-07
Hello,
I want to optimize the display of an ASP.NET page according to the client window area of the Browser. Is there a way to get this?

Thank you
Henri
0
Comment
Question by:htourigny
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 9

Expert Comment

by:AsishRaj
ID: 24759941
u can get the screen width and height using javascript.


<Script language="javascript">
function getScreenSize()
{
var screenheight=screen.height;
alert(screenheight);
var screenWidth=screen.width
alert(screenWidth);
}

Open in new window

0
 
LVL 9

Expert Comment

by:AsishRaj
ID: 24759968
Sorry i didnt see you wanted Server side code

http://www.codeproject.com/KB/aspnet/detectbrowser.aspx

Another one is

 Page.Request.Browser.ScreenPixelsWidth
 Page.Request.Browser.ScreenPixelsHeight



0
 
LVL 9

Expert Comment

by:AsishRaj
ID: 24760476
did you get it working.

Let us know if you need additional help
0
 

Author Comment

by:htourigny
ID: 24761847
Page.Request.Browser.ScreenPixelsWidth and Page.Request.Browser.ScreenPixelsHeight always give 640 x 480 and the real size is different. This is true also when request is a postback. I tried with IE 7 and IE 8
0
 
LVL 9

Accepted Solution

by:
AsishRaj earned 1500 total points
ID: 24767329
The easiest way would be using Javascript because postback processing happens on server side but javascript is executed on client side.


0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question