搜索和MVC2 ASP网同一页面上显示 [英] Search and display on same page in mvc2 asp net
本文介绍了搜索和MVC2 ASP网同一页面上显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有一个文本框,一个简单的搜索表单。并在提交表单我的文本框的内容发送到返回给我结果的存储过程。欲被显示的相同的网页的形式是对结果,除了仅低于它
have a simple search form with a textbox. And upon submitting the form I send the contents of the textbox to a stored procedure which returns to me the results. I want the results to be displayed on the same page the form was, except just below it.
现在,我做以下,但它不工作正是我想要的方式:
Right now I'm doing the following but it's not working out exactly the way I want:
推荐答案
您可以使用阿贾克斯
来解决这个问题。
You can use Ajax
to solve the problem.
<div>
`@using (Ajax.BeginForm("action", "controller", new AjaxOptions
{
UpdateTargetId = "results",
HttpMethod = "GET",
}))
{
@Html.TextBox()
<input type="submit" value="Search" />
}`
<div id="results"></div>
</div>
这篇关于搜索和MVC2 ASP网同一页面上显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文