Logo 
Search:

Asp.net Forum

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds

Screen

  Asked By: Seth    Date: Jul 09    Category: Asp.net    Views: 581
  

I would like to know how to get the display, in the code-behind, of the screen.
I mean, 1024 X 768 or 800 X 600 , etc...

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Brandon Tucker     Answered On: Jul 09

Your code behind executes at the server - so there is no screen.

So you'll have to do it client side and post it to the server, something like


<body>
<input type=hidden id=screenstuff>
<script>
screenstuff.value = screen.width + "_" + screen.height + "_" +
screen.colorDepth + "_" + document.body.clientWidth + "_"+
document.body.clientHeight;
<script>

These functions can change depending on browser ( I think, but don't quote me)

Then split around "_" at server

str = Request.Form["screenstuff"]
string[] s = str.Split('_');
for (int i =0; i<s.Length;i++)
{
Response.Write(s[i] + "<br>");
}

 
Answer #2    Answered By: Al Allen     Answered On: Jul 09

Seems good to me. Thanks, I'll try it first thing tomorrow morning. I'll get
back to you.

 
Didn't find what you were looking for? Find more on Screen Or get search suggestion and latest updates.




Tagged: