How to get client Screen Resolution Width/Height at Server Side

后端 未结 2 1237
刺人心
刺人心 2021-01-20 13:17

I can get client screen resolution using client side script \'javascript\',

but I dont want to do that.

I also tried Request.Browser.ScreenPixelsWidth<

相关标签:
2条回答
  • 2021-01-20 14:11

    Information such as client screen resolution is never sent to the server in the HTTP request so you may forget about it. The only way is to use javascript and then pass this information to the server (AJAX, form post, link, ...). You could also use some proprietary browser plugin like Flash, Silverlight, Java Applet, ActiveX, ...

    0 讨论(0)
  • 2021-01-20 14:12

    I've just had to do something similar, and what I've done is use Javascript to set a cookie when the user loads the login page, then every subsequent request can retrieve the cookie server side.

    The approach is not without it's limitations, but it does provide the information you need for the most part.

    0 讨论(0)
提交回复
热议问题