Get user screen size in asp.net

How do I find users screen size using asp.net but without using JavaScripts or third party utility?

I need to find screen width and height so that I can present users with different content.

Kosta
yunetAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
dorwardConnect With a Mentor Commented:
You can't.

By default the browser doesn't send details about the users resolution to servers. The only way to find it out is to run JavaScript (or another client side technology) on the client and then have the user follow a link with the information GET encoded or to submit a form.

I suggest http://www.allmyfaqs.com/faq.pl?AnySizeDesign rather then screensniffing.
0
 
tncbbthositgConnect With a Mentor Commented:
If you want the screen size, you'll have to create an asp page that asks for the height and width and redirect to it.

What you will have is one page which's javascript looks like so:

<html>
 <head>
  <script type="text/javascript">
   funcion redirect(){
    top.location.replace("www.myweb.com/size.asp?height=" + screen.height + "&width=" + screen.width);
   }
  </script>
 </head>
 <body onload="redirect()">
 </body>
</html>

then in your asp, retrieve the width and height as if it was in a form.

Hope this helps,
Pat
0
 
dorwardCommented:
recommendation: Split
0
All Courses

From novice to tech pro — start learning today.