I have a web application in C#. I need to be able to detect the user’s browser width. How is this possible? I know that you can detect the browsers width using javascript/jquery….but how can I make this available serve-side (from within my C# code).
Share
I would make a hiddenfield and fill it by using jQuery http://api.jquery.com/width/
So you can choose window or document and fill a hiddenfield
Please note that clientidmode is only for asp.net 4 and above
http://msdn.microsoft.com/en-us/library/system.web.ui.control.clientidmode.aspx
edit another option is to use jquery and do an ajax post to an *.ashx or *.asmx