M
M
Maxim Isaev2019-12-17 21:46:27
ASP.NET
Maxim Isaev, 2019-12-17 21:46:27

How to pass HtmlAttribute to another controller method through ActionLink?

How to pass HtmlAttribute to another controller method through ActionLink?
@Html.ActionLink((string)ViewBag.User.Login, "User","WatchProfile", new { id = ViewBag.UserId}) - this is how it passes the Menu controller, the method is correct
@Html.ActionLink((string)ViewBag.User .Login, "User", "WatchProfile") - passes as it should, but since attribute no error

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Serhii81, 2019-12-18
@Serhii81

@Html.ActionLink((string)ViewBag.User.Login, "Action","Controller", null, new { id = ViewBag.UserId})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question