Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Solution and summary:</p> <p>The problem occurs when it's time to encode the submit button. Our buttons are generated as <code>&lt;button ... &gt;&lt;span&gt; Submit&lt;/span&gt;&lt;/button&gt;</code>; when it's time to build the request, all other browsers, IE8 included, are smart enough to take only "Submit". IE7 sends all inner HTML. We've had this error in other contexts, but this time I got set on a false path by the JSON error.</p> <p>I cannot and will not change from <code>&lt;% Http.Button %&gt;</code> to an input; it's beyond me how this could be even considered a viable solution; that extension is used for very good reasons, and if ditching it was an option I wouldn't have asked this question in the first place. </p> <p>The solution was to add a new filter, extending <code>RequestValidator</code>, and check the request for the offending <code>span</code> tag; if found, replace with the text.</p> <pre><code>public class HttpRequestValidator : RequestValidator { protected override bool IsValidRequestString( HttpContext context, string value, RequestValidationSource requestValidationSource, string collectionKey, out int validationFailureIndex) { // Check if the Request.QueryString contains a post value of "&lt;span&gt;.....&lt;/span&gt;" if (requestValidationSource == RequestValidationSource.Form &amp;&amp; !string.IsNullOrEmpty(value) &amp;&amp; value.StartsWith("&lt;span&gt;", StringComparison.InvariantCultureIgnoreCase)) { var match = Regex.Match(value, @"\A&lt;span&gt;(.*?)&lt;/span&gt;\Z", RegexOptions.IgnoreCase); if (match.Success &amp;&amp; match.Groups.Count &gt; 1) return base.IsValidRequestString( context, match.Groups[1].Value, requestValidationSource, collectionKey, out validationFailureIndex); } return base.IsValidRequestString( context, value, requestValidationSource, collectionKey, out validationFailureIndex); } } </code></pre> <p>You'll also need to add it in <code>web.config</code>; search for <code>httpRuntime</code> and replace it with</p> <pre><code>&lt;httpRuntime requestPathInvalidCharacters="&amp;lt;,&amp;gt;,*,%,:,\" requestValidationType=" ... .HttpRequestValidator" maxRequestLength="40920" maxQueryStringLength="10000"/&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload