如何获取当前输入值并在同一视图中使用它(C# MVC)?

问题描述 投票:0回答:0
<input type="text" id="investorinfo" name="investorinfo" />
<button type="submit" class="btn_1 medium">Search</button>

我正在尝试从

<input>
中获取一个字符串,当用户按下搜索按钮时,我想将该字符串用作下面代码块中的
searchparameter

我尝试在 JS 中使用,但我必须将它传递给视图中的 c# 代码块,但我无法使其工作。

@Ajax.ActionLink("Search", "ListCity", "Home", new { searchparameter = "inputfrominvestorinfo" }, new AjaxOptions() { HttpMethod = "GET", InsertionMode = InsertionMode.Replace, UpdateTargetId = "Citys" }, new { @class = "form-control", @style = "color:pink" })
javascript c# html asp.net-mvc view
© www.soinside.com 2019 - 2024. All rights reserved.