I am redirecting to another page with Id as a parameter. I passed Id successfully by using RedirectToAction
but the controller action
method is not accepting id and giving it null
always even when there is Id in the url
Code to Redirect to that page
return RedirectToAction("myaction", new System.Web.Routing.RouteValueDictionary(
new { controller = "mycontroller", action = "myaction", Id = 1 }));
Url looks like this
http://localhost:1234/mycontroller/myaction/1
The Action
looks llike this
[HttpGet]
public ActionResult myaction(int? Id)
{
// ID is null here
}