Getting screen resolutions
-
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
<!-- if ((screen.width>=1024) && (screen.height>=768)) { alert("usermessage") } else { } //-->
Regards, Sylvester G sylvester_g_m@yahoo.com
-
<!-- if ((screen.width>=1024) && (screen.height>=768)) { alert("usermessage") } else { } //-->
Regards, Sylvester G sylvester_g_m@yahoo.com
-
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
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.