如何在asp.net mvc中创建简单的子菜单?

时间:2019-04-26 15:29:35

标签: c# asp.net-mvc razor

我无法为ASP.net MVC5站点创建子菜单。我想以最简单的方式做到这一点。我要在“工作人员”下创建“添加和删除”子菜单。

代码如下,

    <body>
<div class="navbar navbar-inverse navbar-fixed-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data- 
    toggle="collapse" data-target=".navbar-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            @Html.ActionLink("JS Online - Accountant", "Index", "Home", 
    new { area = "" }, new { @class = "navbar-brand" })
        </div>
        <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav">

                <li>@Html.ActionLink("Sales", "", "")</li>
                <li>@Html.ActionLink("Purchases", "", "")</li>
                <li>@Html.ActionLink("Customers", "", "")</li>
                <li>@Html.ActionLink("Recieve Amount", "", "")</li>
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown">@Html.ActionLink("Staff", "", "")</a>
                    <ul class="dropdown-menu">
                        <li><a>@Html.ActionLink("Add", "Add", "Log")</a></li>
                        <li><a>@Html.ActionLink("Delete", "Delete", "Log")</a></li>
                    </ul>
                </li>

            </ul>
            @Html.Partial("_LoginPartial")
        </div>
    </div>
</div>
<div class="container body-content">
    @RenderBody()
    <hr />
    <footer>
        <p>&copy; @DateTime.Now.Year - JS Online</p>
    </footer>
</div>

@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@RenderSection("scripts", required: false)

0 个答案:

没有答案