0
我使用ajax $ .post調用重定向到行動是索引,從索引我需要調用其查看頁面,同時調試其查看頁面,但我不能看到在瀏覽器中一樣。這是我的Ajax代碼和行動代碼:重定向到查看從行動中的頁面#
AJAX代碼:
$("#btnSearch").click(function() {
var val=$('#whereSearch').val();
$.post("Search/Index/",{where:val});
});
動作代碼:你爲什麼要使用AJAX這個
public ActionResult Index(string where)
{
var q = searchQuery(where);
ViewBag.val = q;
return View();
}
它的工作!謝謝.. – user3014311