简体   繁体   中英

Redirecting using @Url.Action in MVC

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 .

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM