0
我有以下代碼發佈到我的搜索Json。問題是url重定向到json搜索並顯示原始json數據。我想返回到我的partialView中的表格。有關我如何實現這一目標的任何想法?如何從部分視圖FormMethod.Get返回JSON數據?
<div>
@using (Html.BeginForm("Search", "Home", Formmethod.Get, new {id="search-form"})){
...
<button id="search-btn">Search</button>
}
</div>
<div>
<table id="search-results">...</table>
</div>
我家的控制器工作正常,但以確保畫面清晰...
public JsonResult Search(/*variables*/)
{
...
return Json(response, JsonRequestBehavior.AllowGet);
}
而且我重定向到「搜索/(我的所有變量)