Html.ActionLink

Joined
Jun 24, 2012
Messages
1
Reaction score
0
Hi,
I have id = “country\city”
I'm using below ActionLink in a table:
@Html.ActionLink("change", "changeCity", new { id = item.myCountyCity })
but because my id has 2 sections separated by backslash every time I click on the link it gives me error. To resolve the problem I wrote this custom route:
routes.MapRoute(
"CityCountyRoute",
"{controller}/{action}/{id}",
new { controller = "Home", action = "Index", county = "", id = "" });
Still this route is not working and I’m still receiving same error.
Thank you for your help in advance

Geeta
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top