We are trying to handle '*'(asterisk) in the querystring for search operation and getting the below error. we have tried using the requesstPathInvalidChacters in webconfig and [FromUri] in Routes, but no luck. The call is not even reaching the controller block
sample request Url: http://localhost:8080/test/search/ABCD*12*234
<httpRuntime targetFramework="4.5.2" maxRequestLength="2097152" requestPathInvalidCharacters="<,>,%,&,:,\,?,*" />
Exception:
<!DOCTYPE html>
<html>
<head>
<title>A potentially dangerous Request.Path value was detected from the client (*).</title>
<meta name="viewport" content="width=device-width" />
<body bgcolor="white">
<span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>
<h2> <i>A potentially dangerous Request.Path value was detected from the client (*).</i> </h2></span>
<font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">
<b> Description: </b>An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
<br><br>
<b> Exception Details: </b>System.Web.HttpException: A potentially dangerous Request.Path value was detected from the client (*).<br><br>
<b>Source Error:</b> <br><br>
<table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code>
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code>
</td>
</tr>
</table>
<br>
<b>Stack Trace:</b> <br><br>
<table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code><pre>
[HttpException (0x80004005): A potentially dangerous Request.Path value was detected from the client (*).]
System.Web.HttpRequest.ValidateInputIfRequiredByConfig() +9859608
System.Web.PipelineStepManager.ValidateHelper(HttpContext context) +53
</pre></code>