I would like to create a list with a string and an int value at the same time like follows:
@Html.ActionLink("Back to List", "IndexEvent", new { location = "location" })
and
@Html.ActionLink("Back to List", "IndexEvent", new { locationID = 1 })
It didn’t work. I guess MVC controller didn’t get the type difference of parameter. So, I had to make a new Action as “IndexEvenyByID” but it requires to have a new view. Since I wanted to keep it simple, is there any way to use same view with respect to different parameters?
Try adding two optional parameters to the
IndexEventaction like this: