Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Getting screen resolutions

Getting screen resolutions

Scheduled Pinned Locked Moved ASP.NET
csharpasp-net
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Icarus123
    wrote on last edited by
    #1

    I am using C# together with ASP.net. I need to check if the screen resolution is equal or bigger than 1024 x 768, if not so, the page wil display a message that wil inform the user to change his res. Thanks Icarus

    S B 2 Replies Last reply
    0
    • I Icarus123

      I am using C# together with ASP.net. I need to check if the screen resolution is equal or bigger than 1024 x 768, if not so, the page wil display a message that wil inform the user to change his res. Thanks Icarus

      S Offline
      S Offline
      Sylvester george
      wrote on last edited by
      #2

      <!-- if ((screen.width>=1024) && (screen.height>=768)) { alert("usermessage") } else { } //-->

      Regards, Sylvester G sylvester_g_m@yahoo.com

      I 1 Reply Last reply
      0
      • S Sylvester george

        <!-- if ((screen.width>=1024) && (screen.height>=768)) { alert("usermessage") } else { } //-->

        Regards, Sylvester G sylvester_g_m@yahoo.com

        I Offline
        I Offline
        Icarus123
        wrote on last edited by
        #3

        Thanks the code works, but now, how would i use the message in the actual web-page? (display it in a table ...et.)

        1 Reply Last reply
        0
        • I Icarus123

          I am using C# together with ASP.net. I need to check if the screen resolution is equal or bigger than 1024 x 768, if not so, the page wil display a message that wil inform the user to change his res. Thanks Icarus

          B Offline
          B Offline
          badgrs
          wrote on last edited by
          #4

          Generally speaking this is a very bad idea. For one there is no way to 100% accurately tell the screen size, whatever method you use. Using javascript will only get the view port size, that is the size of the browser (minus any menus, scrollbars) not the actual screen resolution. Also forcing the user to use a specific resolution is very bad usability practice and any website that does that is either totally crap or hasn't been updated since 1999.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups