小编Res*_*hav的帖子

使用@ url.action调用局部视图使用jquery单击

在@ url.action上调用局部视图。我正在使用url.action显示记录,并希望在用户单击记录时加载部分视图。

这是我的代码,当用户单击它时,我想在该代码上调用部分视图。

<td>
<a href="@Url.Action("Details", new { id=item.TeamId})">
 @Html.DisplayFor(modelItem => item.TeamName)
</a>
</td>
Run Code Online (Sandbox Code Playgroud)

这是我在Div中放置部分视图的位置

<div id="detailsPlace" class="dialog_content3" style="display:none"></div>
         @Html.Partial("_TeamDetails")
    </div>
Run Code Online (Sandbox Code Playgroud)

这是我要渲染的局部视图

@model light.ViewModels.ViewDetailTeam
@{
    var item = Model.Team;
}

    <div class="dialogModal_header">@Html.Label(item.TeamName)</div>
    <div class="dialogModal_content">
        <div class="main-content">
            <div class="navi-but">
                    @Html.Label(item.TeamName)
                </div>
                    @Html.Label(item.Description)
                </div>
            </div>
        </div>
Run Code Online (Sandbox Code Playgroud)

这是我的控制器

public ActionResult Details(int id)
        {

            lightCoreModel.User loggedInUser = new lightCoreModel.User();


                ViewDetailTeam viewDetailTeam = new ViewDetailTeam();
                ViewData["DetailModel"] = viewDetailTeam;
                viewDetailTeam.Retrieve(id);
                return PartialView("_TeamDetails",viewDetailTeam);

        }
now i am facing this problem with pop up its showing me the …
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc jquery url.action razor

5
推荐指数
2
解决办法
3万
查看次数

标签 统计

asp.net-mvc ×1

jquery ×1

razor ×1

url.action ×1