我需要Razor @ Html.ActionLink将数据从一个页面传递到另一个页面。 Action链接如下:
@Html.ActionLink("Add to Plan","Index","Plan", null, new {@id="submit", @name="submit", @class="slider-btn"})
我有这样的价值:
<input type="hidden" id="searchbar" name="searchbar" value="some_value" />
答案 0 :(得分:3)
应该使用这个...
@Html.ActionLink("Add to Plan","Index","Plan", new { searchbar = "some_value" }, new { ... })