Rafat Ahmad
Rafat Ahmad

Reputation: 169

Pass data with Razor ActionLink

I need Razor @Html.ActionLink to pass data from one page to another. The Action link is like:

@Html.ActionLink("Add to Plan","Index","Plan", null, new {@id="submit", @name="submit", @class="slider-btn"})

I have a value like this:

<input type="hidden" id="searchbar" name="searchbar" value="some_value" />

Upvotes: 1

Views: 616

Answers (1)

Rafat Ahmad
Rafat Ahmad

Reputation: 169

Should use this...

@Html.ActionLink("Add to Plan","Index","Plan", new { searchbar = "some_value" }, new { ... })

Upvotes: 3

Related Questions