0
votes

I have a scenario, where I have to redirect using hyper link in MVC and there I have to add action name, controller name & object name. When I try to enter the object name, It is not finding that object name. How to get the object name in Url.Action?

My Url in UI has to look like this: localhost:00/area/Controller/ActionMethod/ItemId.

Here I need help how to add the Itemid in Url.Action.

1
href="@Url.Action("ActionMethodName", "Controller", new { area="AreaName"} now I have this (localhost:00/area/Controller/ActionMethod), I need to add one more itemid and go to that url(localhost:00/area/Controller/ActionMethod/ItemId) .Newbie
Yes, but itemid is not finding.Newbie

1 Answers

0
votes

@Url.Action is used inside <a> tag.

<a href="@Url.Action("ActionMethod", "Controller", new { itemId = ItemId })" >LinkName</a>