How to determine browser window size or resolution on server side?

Jak
Jak
Member
394 Points
162 Posts

How I can determine browser window size or resolution on server side in c#?

Views: 120
Total Answered: 1
Total Marked As Answer: 0
Posted On: 17-Apr-2021 22:08

Share:   fb twitter linkedin
Answers
Smith
Smith
Participant
586 Points
138 Posts
         

There is not straightforward package/method to determine the client browser resolution on server side. We can use Javascript to get the viewport document width and height. Then pass the values back via a hidden form input or ajax.

var width = $(window).width();
var height = $(window).height();

And for  getting document width and height:

var width = $(document).width();
var height = $(document).height();
Posted On: 21-Apr-2021 05:28
 Log In to Chat