This is for the project that I am doing at the university. We use ASP.NET MVC2 to create a mini-prototype website to show what we can do.
Now I have a controller called ItemController.cs , view Item/Index.aspx , model Item.cs and ViewModel ViewItems.cs . I am using ViewModel to transfer information to a view from a controller. My question is: how can I call the controller method with parameters? I am currently using
Html.ActionLink("View Event Items", "Index", "Item")
which points to the ItemController Index() method. Let's say I want it to accept the int parameter ( Index(int eventId) ). How do I write ActionLink to pass this parameter?
Also, if I have any errors in the way I think this works, feel free to mention them.
source share