0

我的主索引视图中有这些 ActionLink:

<p>@Ajax.ActionLink("Releases", "Index", "Release", new AjaxOptions { InsertionMode = InsertionMode.Replace, UpdateTargetId = "ContentPanel" })</p>
<p>@Ajax.ActionLink("Templates", "Index", "Template", new AjaxOptions { InsertionMode = InsertionMode.Replace, UpdateTargetId = "ContentPanel" })</p>
<p>@Ajax.ActionLink("Testplans", "Index", "Testplan", new AjaxOptions { InsertionMode = InsertionMode.Replace, UpdateTargetId = "ContentPanel" })</p>

下面是这个:

<div id="ContentPanel">
    @RenderBody()
</div>

当我依次单击每个链接 Release、Templates、Testplans 时,视图的切换工作。

当我按此顺序单击时:

Releases
Templates
Releases
Templates

切换不再起作用。问题似乎是当我在控制器索引方法中设置断点时:

public ActionResult Index()
{
    return View();
}

索引操作在 looooooop 中调用??

为什么这个?

4

1 回答 1

1

你可以试试这个代码:

Layout = Request.IsAjaxRequest() ? null : "~/Views/Shared/_Layout.cshtml";
于 2012-04-19T17:00:47.060 回答