Is it possible to check if the client browser has javascript enabled from ASP.NET code?
I was hoping to ideally do this on PreRender of controls, or PageLoad, so that I can change how they look.
Any suggestions, work arounds etc would be much appreciated.
You can’t do it, without making a subsequent request I’m afraid.
There are explanations that can be found by doing a search on Google most use an AJAX call or a hidden field that gets popluated via some javascript, that won’t get run if Javascript is disabled.
If you have to do it then I’d try doing it on the very first request from the client, and save a cookie (or somethign similar), then check the value of the cookie on subsequent requests. This assumes that the user doesn’t enable / disable Javascript often. You could also store a value in the session.
I hope that helps