Tag: actionresult

堆栈不足以继续安全地执行程序。 ASP.NET MVC 4

我的搜索function似乎在无限循环中继续,每次我的调试命中POST动作结果下面的操作被触发。 在我的Masterpage.cshtml中,我有以下操作: @Html.Action(“Search”, “Search”) 这是得到以下错误的部分: 堆栈不足以继续安全地执行程序。 这可能是因为调用堆栈上的函数太多或堆栈上的函数占用太多堆栈空间。 在我的SearchController中,我有一个get和post动作方法: [HttpGet] public ActionResult Search() { return PartialView(“SearchFormPartial”); } 这个返回包含以下内容的部分视图: @using (Ajax.BeginForm(“Search”, “Search”, FormMethod.Post, new AjaxOptions { InsertionMode = InsertionMode.Replace, HttpMethod = “POST” })) { @Html.TextBox(“query”, “”, new { @class = “search-query”, @placeholder=”Search news…”, @spellcheck=”false”}) } 它基本上是一个带有文本框和提交按钮的表单。 这是http post actionresult: [HttpPost] public ActionResult Search(string query) { if (query […]

如何在Redirecttoaction中传递List

我想从RedirectToAction方法传递多个参数 我怎么能通过? 我的一个行动方法 [HttpPost, ActionName(“SelectQuestion”)] public ActionResult SelectQuestion(string email,List model) { List fadd = new List(); for (int i = 0; i < model.Count; i++) { if (model[i].SelectedCheckbox == true) { List f = new List(); fadd.Add(model[i]); } } return RedirectToAction(“Question”, new { email = email, model = fadd.ToList() }); } 我的另一种行动方法 [HttpGet] public ActionResult […]