A potentially dangerous Request.Form value was detected from the clienthttp://forums.asp.net/t/1235144.aspx/1?A+potentially+dangerous+Request+Form+value+was+detected+from+the+clientThu, 12 Jan 2012 17:51:43 -050012351442239950http://forums.asp.net/p/1235144/2239950.aspx/1?A+potentially+dangerous+Request+Form+value+was+detected+from+the+clientA potentially dangerous Request.Form value was detected from the client <p>I am getting the message:&nbsp;</p> <p><em>A potentially dangerous Request.Form value was detected from the client </em> </p> <p>when trying to save the read the value from a textarea which has the text ON=45 in it.&nbsp; It seems that the letters ON and = are causing a problem?&nbsp; If I put ON.=45 it is ok.&nbsp; Can someone explain to me how this is considered a potentially dangerous value?&nbsp; I'm trying to explain to my users why this would be bad, but I'm at a loss to explain.</p> <p>Also, turning off the Validation for the page is not an option.</p> 2008-03-18T12:38:09-04:002239990http://forums.asp.net/p/1235144/2239990.aspx/1?Re+A+potentially+dangerous+Request+Form+value+was+detected+from+the+clientRe: A potentially dangerous Request.Form value was detected from the client <p>Hi,</p> <p>Put validateRequest=&quot;false&quot; in your page directive or web.config file.</p> <p>http://msdn2.microsoft.com/en-us/library/ms972967.aspx</p> <p>Thanks&nbsp;</p> <p>&nbsp;</p> 2008-03-18T12:54:49-04:002239998http://forums.asp.net/p/1235144/2239998.aspx/1?Re+A+potentially+dangerous+Request+Form+value+was+detected+from+the+clientRe: A potentially dangerous Request.Form value was detected from the client <p>As stated in my post, I cannot turn the Validation off.&nbsp; This is happening inside a user control, so I can't turn it off.&nbsp; And, I don't consider it an option to turn it off at the Web.config level.&nbsp; I would just like someone to explain to me what is wrong with ON=&nbsp;&nbsp;&nbsp; as opposed to AL= or other combos of letters.</p> 2008-03-18T12:58:08-04:002240004http://forums.asp.net/p/1235144/2240004.aspx/1?Re+A+potentially+dangerous+Request+Form+value+was+detected+from+the+clientRe: A potentially dangerous Request.Form value was detected from the client <p>try encoding the value. (html encode)</p> 2008-03-18T13:00:05-04:002240014http://forums.asp.net/p/1235144/2240014.aspx/1?Re+A+potentially+dangerous+Request+Form+value+was+detected+from+the+clientRe: A potentially dangerous Request.Form value was detected from the client <p></p> <blockquote><span class="icon-blockquote"></span> <h4>sc1977</h4> what is wrong with ON=&nbsp;</blockquote> &nbsp; <p></p> <p>The .NET framework is throwing up an error because it detected something in the entered text which looks like an HTML statement. The text doesn't need to contain valid HTML, just anything with opening and closing angled brackets (&quot;&lt;...&gt;&quot;).</p> <p>The reason behind the error is as a security precaution. Developers need to be aware that users might try to inject HTML (or even a script) into a text box which may affect how the form is rendered. For further details see <a href="http://www.asp.net/learn/whitepapers/request-validation/">www.asp.net/learn/whitepapers/request-validation/</a>.</p> <p>This checking was not performed in the .NET 1.0 framework and was introduced with the .NET 1.1 framework.</p> <p>Referenced Link &gt;&nbsp; <a href="http://www.cryer.co.uk/brian/mswinswdev/ms_vbnet_server_error_potentially_dangerous.htm"> Troubleshooting: A potentially dangerous Request.Form value was detected</a></p> <p>hope it helps./.&nbsp;</p> 2008-03-18T13:03:42-04:002240030http://forums.asp.net/p/1235144/2240030.aspx/1?Re+A+potentially+dangerous+Request+Form+value+was+detected+from+the+clientRe: A potentially dangerous Request.Form value was detected from the client <p>If you are telling me: <em>&quot;The text doesn't need to contain valid HTML, just anything with opening and closing angled brackets (&quot;&lt;...&gt;&quot;).&quot;</em></p> <p>I don't see how that will apply to the text entered of <em>&quot;ON=&quot;</em>?&nbsp; I haven't entered any angled brackets.</p> <p><em></em>&nbsp;</p> 2008-03-18T13:08:26-04:002240034http://forums.asp.net/p/1235144/2240034.aspx/1?Re+A+potentially+dangerous+Request+Form+value+was+detected+from+the+clientRe: A potentially dangerous Request.Form value was detected from the client <p></p> <blockquote><span class="icon-blockquote"></span> <h4>naimulah</h4> <p>try encoding the value. (html encode)</p> <p></p> </blockquote> <p></p> <p>&nbsp;I cannot encode the value because it doesn't even make it to the server btn click event (I ran it in debug&nbsp;mode)&nbsp;before it crashes out.&nbsp; The problem lies in the the trasport of the textvalue back to the server for processing.</p> 2008-03-18T13:09:33-04:002240039http://forums.asp.net/p/1235144/2240039.aspx/1?Re+A+potentially+dangerous+Request+Form+value+was+detected+from+the+clientRe: A potentially dangerous Request.Form value was detected from the client <p>It is trying to prevent SQL injection. INNER JOIN Table t ON t.Id = OtherTable1.Id</p> <p>Hope this helps.</p> <p>Tim</p> 2008-03-18T13:12:48-04:002240046http://forums.asp.net/p/1235144/2240046.aspx/1?Re+A+potentially+dangerous+Request+Form+value+was+detected+from+the+clientRe: A potentially dangerous Request.Form value was detected from the client <p></p> <p><a href="http://forums.asp.net/t/1151879.aspx"></a></p> <blockquote><span class="icon-blockquote"></span> <h4>sc1977</h4> <p></p> <blockquote><span class="icon-blockquote"></span> <h4>naimulah</h4> <p>try encoding the value. (html encode)</p> <p></p> </blockquote> <p></p> <p>&nbsp;I cannot encode the value because it doesn't even make it to the server btn click event (I ran it in debug&nbsp;mode)&nbsp;before it crashes out.&nbsp; The problem lies in the the trasport of the textvalue back to the server for processing.</p> <p></p> </blockquote> <p></p> <p>&nbsp;</p> <p>FYI about encoding</p> <p><a href="http://forums.asp.net/t/1151879.aspx">http://forums.asp.net/t/1151879.aspx</a></p> 2008-03-18T13:15:46-04:002240057http://forums.asp.net/p/1235144/2240057.aspx/1?Re+A+potentially+dangerous+Request+Form+value+was+detected+from+the+clientRe: A potentially dangerous Request.Form value was detected from the client <p></p> <blockquote><span class="icon-blockquote"></span> <h4>stratboogie</h4> <p>It is trying to prevent SQL injection. INNER JOIN Table t ON t.Id = OtherTable1.Id</p> <p>Hope this helps.</p> <p>Tim</p> <p></p> </blockquote> <p></p> <p>&nbsp;</p> <p>Thank you!&nbsp; At least I know why I can't have &quot;ON =&quot;!</p> 2008-03-18T13:20:12-04:002240065http://forums.asp.net/p/1235144/2240065.aspx/1?Re+A+potentially+dangerous+Request+Form+value+was+detected+from+the+clientRe: A potentially dangerous Request.Form value was detected from the client <p></p> <blockquote><span class="icon-blockquote"></span> <h4>sc1977</h4> <p></p> <blockquote><span class="icon-blockquote"></span> <h4>stratboogie</h4> <p>It is trying to prevent SQL injection. INNER JOIN Table t ON t.Id = OtherTable1.Id</p> <p>Hope this helps.</p> <p>Tim</p> <p></p> </blockquote> <p></p> <p>&nbsp;</p> <p>Thank you!&nbsp; At least I know why I can't have &quot;ON =&quot;!</p> <p></p> </blockquote> <p></p> <p>&nbsp;</p> <p>One more thing.&nbsp; Why would the text Ontario = 45 also fail?&nbsp; Wouldn't this be different enough for it to know it is not sql?&nbsp; Because the text Alberta = 45 works.&nbsp;</p> <p>Can you tell I'm Canadian?</p> 2008-03-18T13:23:18-04:002240090http://forums.asp.net/p/1235144/2240090.aspx/1?Re+A+potentially+dangerous+Request+Form+value+was+detected+from+the+clientRe: A potentially dangerous Request.Form value was detected from the client <p>My guess would be it conains &quot;ON&quot; and &quot;=&quot;</p> <p>You could maybe have a JS function that searches the text before it is sumbitted to the server. And if your text contains certain keywords, do something special in that scenario. Kind of pain I know. :-)</p> <p>Tim</p> 2008-03-18T13:29:38-04:002987365http://forums.asp.net/p/1235144/2987365.aspx/1?Re+A+potentially+dangerous+Request+Form+value+was+detected+from+the+clientRe: A potentially dangerous Request.Form value was detected from the client <p>&nbsp;</p> <p>its working in my scenerio</p> <p>&nbsp;</p> <p>thanking you&nbsp; very much .<br> </p> 2009-03-06T11:02:32-05:003744882http://forums.asp.net/p/1235144/3744882.aspx/1?Re+A+potentially+dangerous+Request+Form+value+was+detected+from+the+clientRe: A potentially dangerous Request.Form value was detected from the client <p>1) For ASP.NET MVC we have to add [ValidateInput(false)] on top of the action result so that it will not validate the field at run-time.&nbsp;</p> <p>2 )Nothing else would work..Ex: adding ValidateInput = &quot;false&quot; to the Pagedirective (in the view)</p> <p>or </p> <p>3) adding ValidateInput = &quot;false&quot;&nbsp;it in the web.config.</p> <p><br> </p> <p>Once again for MVC only the First Solution will work. 2nd and 3rd solution will not work.</p> 2010-03-22T21:11:38-04:004187162http://forums.asp.net/p/1235144/4187162.aspx/1?Re+A+potentially+dangerous+Request+Form+value+was+detected+from+the+clientRe: A potentially dangerous Request.Form value was detected from the client <p style="margin-top:0px; margin-right:0px; margin-bottom:1.1538em; margin-left:0px; padding:0px"> You need to do couple of modification to you application to get this fixed.Have a look.</p> <p style="margin-top:0px; margin-right:0px; margin-bottom:1.1538em; margin-left:0px; padding:0px"> 1. Add &lt;<span style="font-size:9.5pt; font-family:consolas; color:#a31515">httpRuntime</span><span style="font-size:9.5pt; font-family:consolas; color:blue">&nbsp;</span><span style="font-size:9.5pt; font-family:consolas; color:red">requestValidationMode</span><span style="font-size:9.5pt; font-family:consolas; color:blue">=</span><span style="font-size:9.5pt; font-family:consolas">&quot;<span style="color:blue">2.0</span>&quot;<span style="color:blue">&nbsp;/&gt;&nbsp;</span></span>in you application web.config</p> <p>2. Add RequestValidation=&quot;false&quot; on your page</p> <h3><span class="Apple-style-span" style="font-weight:normal"><a href="http://www.a2zmenu.com/AspNet/A-potentially-dangerous-Request-Form-value-was-detected.aspx" title="http://www.a2zmenu.com/AspNet/A-potentially-dangerous-Request-Form-value-was-detected.aspx">A potentially dangerous Request.Form value was detected</a></span></h3> <p style="margin-top:0px; margin-right:0px; margin-bottom:1.1538em; margin-left:0px; padding:0px"> <br> </p> 2010-11-27T20:30:28-05:004501050http://forums.asp.net/p/1235144/4501050.aspx/1?Re+A+potentially+dangerous+Request+Form+value+was+detected+from+the+clientRe: A potentially dangerous Request.Form value was detected from the client <p>Is there any other way beside setting the validaterequest to false ???</p> 2011-07-11T10:42:18-04:004515740http://forums.asp.net/p/1235144/4515740.aspx/1?Re+A+potentially+dangerous+Request+Form+value+was+detected+from+the+clientRe: A potentially dangerous Request.Form value was detected from the client <p>Hi had the same when someone tryin to use &amp;# . A potentially dangerous Request.Form value was detected from the klient. Somebody knows why &amp;# is dangerous? Is it html or sql code?</p> <p>Thanks</p> 2011-07-20T08:10:34-04:004515947http://forums.asp.net/p/1235144/4515947.aspx/1?Re+A+potentially+dangerous+Request+Form+value+was+detected+from+the+clientRe: A potentially dangerous Request.Form value was detected from the client <p>This is because of # symbol.</p> <p>It is used in store procedure to declare local temporary tables that's why it's carraying</p> <h3>A potentially dangerous Request.Form value was detected from the client.</h3> <p></p> <p></p> <p>It's also notable that it's not required that it should be valid keyword of sql to generate this error.</p> 2011-07-20T09:44:59-04:004515960http://forums.asp.net/p/1235144/4515960.aspx/1?Re+A+potentially+dangerous+Request+Form+value+was+detected+from+the+clientRe: A potentially dangerous Request.Form value was detected from the client <p>but if im useing for example 3#&nbsp; or any different option its fine, it happens only with &amp;#</p> 2011-07-20T09:50:21-04:004516317http://forums.asp.net/p/1235144/4516317.aspx/1?Re+A+potentially+dangerous+Request+Form+value+was+detected+from+the+clientRe: A potentially dangerous Request.Form value was detected from the client <p><strong>Paste the code where you are assigning value.</strong></p> <p><strong>It's important to note which language you are working on because &amp; symbol is also used in vb to concatnate two strings.&nbsp;</strong></p> 2011-07-20T13:09:38-04:00