Sending data with ActionLink GET call

imarink

New Member
How should i do this without using the RouteData.Values["id"];I am using this action call from the view\[code\]@Html.ActionLink("Post","Create","Post", new {id=item.Id }, null)\[/code\]And this is the Action\[code\] // GET: /Post/Create public ActionResult Create() { var x = (string)RouteData.Values["id"]; var model = new Post() { DateCreated = DateTime.Now, BlogID = int.Parse(x)}; return View(model); } \[/code\]is there a better way of doing this?
 
Back
Top