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

问题描述 投票:0回答:0

    <input type="text" id="investorinfo" name="investorinfo" />
    <button type="submit" class="btn_1 medium">Search</button>

我尝试从输入中获取一个字符串,当用户按下搜索按钮时,我想将它用作搜索参数,您会在下面的代码块中看到。

我尝试使用 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.