Current ActionResult:
[Route(\"EvaluatorSetup/{evalYear}/{department}\")]
public ActionResult RoutedEvaluatorSetup(int evalYear, string department)
{
ret
Try
[Route("EvaluatorSetup/{evalYear}/{department:string}")]
I believe the default is int
.
The issue is the .
in the URL.
By default, if a .
is present the StaticFileHandler
handles the request and looks for a filename matching the path on the file system. To override this behavior, you can assign a handler to a URL you are trying to use. For example, adding the following to your web.config:
<system.webServer>
<handlers>
<add name="UrlRoutingHandler" path="/EvaluatorSetup/*" verb="GET" type="System.Web.Routing.UrlRoutingHandler" />
</handlers>
</system.webServer>
will force any request starting with /EvaluatorSetup/
to use the UrlRoutingHandler
(the handler associated with MVC routes).
** Solution Supplement **
I found that this solution worked when I ALSO added the following to the httpRuntime element in web.config:
<system.web>
<httpRuntime relaxedUrlToFileSystemMapping="true" />
</system.web>