<p>I'm thinking this might be a quick and easy way to lower the form spam on our site just a little bit. The idea being that (I have read) spammers aren't running with javascript enabled. (Or at least they are accessing your website without running javascript. I.e., they aren't browsing up to it in IE or FF.</p>

<p>I can use .asp or .aspx.</p>

[{'answer_id': 52347, 'author': 'Jon Galloway', 'author_id': 5, 'author_profile': 'https://Stackoverflow.com/users/5', 'pm_score': 3, 'selected': False, 'text': '<p>The simplest way is to set a cookie via javascript and check for it on postback.However, if you\'re looking to minimize spam you should actually have the browser perform a simple task which requires javascript execution. See Phil Haack\'s "Invisibile Captcha Validator" control, which has since been included in his Subkismet library: <a href="http://haacked.com/archive/2006/09/26/Lightweight_Invisible_CAPTCHA_Validator_Control.aspx" rel="noreferrer">http://haacked.com/archive/2006/09/26/Lightweight_Invisible_CAPTCHA_Validator_Control.aspx</a></p>\n'}, {'answer_id': 52372, 'author': 'Brian Warshaw', 'author_id': 1344, 'author_profile': 'https://Stackoverflow.com/users/1344', 'pm_score': 0, 'selected': False, 'text': "<p>I see you've accepted the <code>noscript</code> answer, but how will you use this to fight spam? <code>noscript</code> will allow you to add special content for users without JS, but unless you're generating the rest of your site in JS, it will still be available to user agents without JS.</p>\n\n<p>A captcha of some sort is still likely the best bet. Ultimately, you're trying to get the user agent to prove that it's being controlled by a human, so do your best to make it prove that actual fact, instead of something else. Screen readers for the visually impaired typically go without Javascript, too, and many people browsing from mobile devices have Javascript disabled to speed things up.</p>\n"}, {'answer_id': 52379, 'author': 'chrisofspades', 'author_id': 2614, 'author_profile': 'https://Stackoverflow.com/users/2614', 'pm_score': 1, 'selected': False, 'text': '<p>In .net, you can use <code>Request.Browser.JavaScript</code> to detect if the browser supports JavaScript.  However, the user may still have Javascript disabled.  An ugly way to check to see if Javascript is enabled, is to use <code>window.location</code> to redirect to page.aspx?jscript=true, and then check <code>Request.Querystring</code> for that value.</p>\n'}, {'answer_id': 52454, 'author': 'EndangeredMassa', 'author_id': 106, 'author_profile': 'https://Stackoverflow.com/users/106', 'pm_score': 1, 'selected': False, 'text': "<p>So, you want to force users to use JavaScript in order to use your site? I'd rather just use a simple Captcha. If you aren't a big-name site, you can get away with some relatively simple Captchas. </p>\n\n<p>That's how we reduced spam at our site.</p>\n"}, {'answer_id': 171787, 'author': 'matt lohkamp', 'author_id': 14026, 'author_profile': 'https://Stackoverflow.com/users/14026', 'pm_score': 1, 'selected': False, 'text': "<p>To be honest, you shouldn't need to use a server-side language to detect javascript, and furthermore spammers are not necessarily not running javascript. (sorry about the double-negative) Your objective is good, but your approach is wrong - implementing a CAPTCHA, as suggested by a few of our peers, would be a great way to handle this.</p>\n"}]
['https://Stackoverflow.com/questions/52344', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4906/']