Asp.net mvc 3 如何将参数发送到MVC3操作?
我有文本框和按钮(Asp.net mvc 3 如何将参数发送到MVC3操作?,asp.net-mvc-3,textbox,submit,Asp.net Mvc 3,Textbox,Submit,我有文本框和按钮( 索引操作具有关键字参数。如何将文本框中的关键字发送到索引操作?将文本框保存在表单中,并让链接将表单提交到您感兴趣的操作方法。查看@html.BeginForm以获取指针。将文本框保存在表单中,并让链接将表单提交到您感兴趣的操作方法。查看@html.BeginForm中的指针。 <li> @Html.TextBox( "keyword", "", new { @placeholder = "Search", @class = "inputclass" }
索引操作具有关键字参数。如何将文本框中的关键字发送到索引操作?将文本框保存在表单中,并让链接将表单提交到您感兴趣的操作方法。查看@html.BeginForm以获取指针。将文本框保存在表单中,并让链接将表单提交到您感兴趣的操作方法。查看@html.BeginForm中的指针。
<li>
@Html.TextBox( "keyword", "", new { @placeholder = "Search", @class = "inputclass" } )
</li>
<li>
<a href="javascript:send();" >
<img src="@Url.Content( "~/Content/images/search.png" )" width = "83px" height="29px" />
<p class="searchClass">Search</p>
</a>
</li>
<script type="text/javascript">
function send(){
var textboxValue = $('input[name=keyword]').val();
window.location.href = "/Home/Index?keyword=" + textboxValue;
}
</script>
@TextBox(“关键字”,“”,新{@placeholder=“Search”,@class=“inputclass”})
函数send(){
var textboxValue=$('input[name=keyword]')。val();
window.location.href=“/Home/Index?keyword=“+textboxValue;
}
@TextBox(“关键字”,“”,新{@placeholder=“Search”,@class=“inputclass”})
函数send(){
var textboxValue=$('input[name=keyword]')。val();
window.location.href=“/Home/Index?keyword=“+textboxValue;
}
<li>
@Html.TextBox( "keyword", "", new { @placeholder = "Search", @class = "inputclass" } )
</li>
<li>
<a href="javascript:send();" >
<img src="@Url.Content( "~/Content/images/search.png" )" width = "83px" height="29px" />
<p class="searchClass">Search</p>
</a>
</li>
<script type="text/javascript">
function send(){
var textboxValue = $('input[name=keyword]').val();
window.location.href = "/Home/Index?keyword=" + textboxValue;
}
</script>