【发布时间】:2012-11-22 07:29:28
【问题描述】:
对不起,我是 C# 和 ASP.NET 的新手,我看到很多关于这个问题的帖子,但我完全不明白。我试图了解如何通过 HTML.ActionLink 将 GET 参数传递给操作:
这里是网址:
http://localhost:36896/Movies/SearchIndex?searchString=the
我的 CSHTML 页面应该是这样的:
<input type="Text" id="searchString" name="searchString" />
@Html.ActionLink("Search Existing", "SearchIndex", new { searchString = "the"})
这个硬编码参数“the”实际上是有效的,但是我如何选择 id=searchString 的输入元素,比如document.getElementById("searchString").value
谢谢,
【问题讨论】:
标签: asp.net-mvc-4 html.actionlink