I need to setup a query string in a View using MVC and Razor.
Here my code
Controller: Home
ActionResult: Daily
QueryString: DateForLookUp
@Html.ActionLink("Next Day", "Daily", "Home", new { @DateForLookUp = @Model.AddOneDay() })
the result at the moment is
http://mysite.com/Home/Daily?lenght=4
it should be
http://mysite.com/Home/Daily?DateForLookUp=01/01/2014
What I am doing wrong here?
The
Html.ActionLinkhas a lots of overloads.And you are using the wrong overload which interprets your controller name
"Home"as the route values.One of correct overload/sysntax is: