I am trying to allow the user to edit names in an MVC application.
The controller function has this signature:
[Route("function/edit/{id:int}/{name}/{sortorder:int}")]
public ActionResult Edit(int id, string name, int sortorder)
{...}
I am calling it in Javascript like this:
window.location.href = "@Url.Action("Edit", "Function")" + "/" + id + "/" + name + "/" + order;
It all works fine, until the name contains '/' or the name ends with a '.' then i get a "The resource cannot be found." from the server. This makes perfect sense, since the '/' and '.' characters rightly confuses the routing...
But how should i do this?? I want to allow '/' and '.' in the names.