I am having trouble with using attribute routing in ASP.NET MVC 5. Here is the action im using in my controller:
[HttpGet,Route("Home/ChangeID/{MovieInput}")]
public ActionResult ChangeID(int MovieInput)
{
return View();
}
Here is the form I am using to send the parameter to this action:
<form method="get" action="@Url.Action("ChangeID", "Home")">
<label for="movieInput">Change an ID: </label>
<input type="text" id="MovieInput" name="MovieInput" placeholder="Enter Your ID" />
<input type="submit" />
</form>
The route works perfectly with a URL such as
/Home/ChangeID/65
however it does not support the form submission parameter typing where its
/Home/ChangeID?MovieInput=65`.
How can I change the form submission to meet the latter or is there a way to change the route to satisfy a parameter typed this way? `