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. System Resolution

System Resolution

Scheduled Pinned Locked Moved ASP.NET
csharpjavascripttutorial
5 Posts 4 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.
  • S Offline
    S Offline
    sarah_chandran
    wrote on last edited by
    #1

    Can anyone tell me how to find the system's resolution from a c# web application using c# code. I know how it can be done in javascript(screen.height) and in c# windows form we can get the height using (System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height) but i want to know how it can be done using c#. Thanks in advance, -Sarah

    G S I 3 Replies Last reply
    0
    • S sarah_chandran

      Can anyone tell me how to find the system's resolution from a c# web application using c# code. I know how it can be done in javascript(screen.height) and in c# windows form we can get the height using (System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height) but i want to know how it can be done using c#. Thanks in advance, -Sarah

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      No, it can't. The browser doesn't send this information to the server. You have to use javascript to get the information and send it to the server. --- b { font-weight: normal; }

      1 Reply Last reply
      0
      • S sarah_chandran

        Can anyone tell me how to find the system's resolution from a c# web application using c# code. I know how it can be done in javascript(screen.height) and in c# windows form we can get the height using (System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height) but i want to know how it can be done using c#. Thanks in advance, -Sarah

        S Offline
        S Offline
        sathish s
        wrote on last edited by
        #3

        I guess it is not a straight forward one... C# will be executed in the server side.. Even if you have managed to get screen's resolution using c#, it would be the server's resolution, it wont be the client monitor resolution. What i can suggest you is, you can use JS (screen.height,screen.width) store them to hidden input fields and You can access the hidden fields in the server side using c#.

        S 1 Reply Last reply
        0
        • S sarah_chandran

          Can anyone tell me how to find the system's resolution from a c# web application using c# code. I know how it can be done in javascript(screen.height) and in c# windows form we can get the height using (System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height) but i want to know how it can be done using c#. Thanks in advance, -Sarah

          I Offline
          I Offline
          Ista
          wrote on last edited by
          #4

          Actually IE doesn't relay that information. Its a security issue. Netscape will allow that however. boo! hiss! But if you do get it, just store the value in a hidden field then on post back read the info 1 line of code equals many bugs. So don't write any!!

          1 Reply Last reply
          0
          • S sathish s

            I guess it is not a straight forward one... C# will be executed in the server side.. Even if you have managed to get screen's resolution using c#, it would be the server's resolution, it wont be the client monitor resolution. What i can suggest you is, you can use JS (screen.height,screen.width) store them to hidden input fields and You can access the hidden fields in the server side using c#.

            S Offline
            S Offline
            sarah_chandran
            wrote on last edited by
            #5

            ok , thanks guffa snd sathish and ista for taking the time to reply. -- modified at 23:21 Tuesday 28th February, 2006

            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