I am trying to output the following URL using the ASP.Net MVC3 framework and I am a total noob at this stuff:
http://www.foo.com/controller/action/1
Here is my code so far:
@Html.ActionLink("Click here!", "action", new { Controller = "controller" })
This gives me:
http://www.foo.com/controller/action/
What do I need to get a simple hardcoded 1 in there at the end?
To specify route parameters you’ll need to use the following signature
The null at the end represents the HtmlAttributes which you can specify if you like
Also checkout this question “HTML.ActionLink method” for a great description of how ActionLink should be used