【发布时间】:2016-12-09 09:36:12
【问题描述】:
我有一些这样的代码
public ActionResult BookNav(string activeId)
{
return PartialView(activeId);
}
并尝试对该操作进行 Ajax 调用。我使用
形成回调URL@Url.Action("BookNav", "Home", new { activeId = "navHome" })
生成 URL
我在回调期间收到 HTTP 500。为了简化问题,我在浏览器中打开了一个新选项卡并粘贴了该 URL。结果是:
The partial view 'navBios' was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Home/navBios.aspx
~/Views/Home/navBios.ascx
...
但是,如果我粘贴没有查询字符串参数的 URL
我得到了预期的输出。
为什么我的查询字符串中的值被用来选择视图名称,我该如何解决?
【问题讨论】: