登录Angularjs MVC项目VS15后下拉列表不起作用
我正在Visual Studio 2015默认MVC项目中从事AngularJS项目 我已使用引导模板对此默认项目进行了更改 一切正常,但登录后,下拉菜单不会显示my _LoginPartial视图中列出的两个内容。在登录之前,此下拉列表可以正常工作,显示基于If-else条件的_LoginPartail视图的内容 下面是登录部分视图的代码登录Angularjs MVC项目VS15后下拉列表不起作用,angularjs,asp.net-mvc,bootstrap-4,visual-studio-2015,Angularjs,Asp.net Mvc,Bootstrap 4,Visual Studio 2015,我正在Visual Studio 2015默认MVC项目中从事AngularJS项目 我已使用引导模板对此默认项目进行了更改 一切正常,但登录后,下拉菜单不会显示my _LoginPartial视图中列出的两个内容。在登录之前,此下拉列表可以正常工作,显示基于If-else条件的_LoginPartail视图的内容 下面是登录部分视图的代码 @using Microsoft.AspNet.Identity @if (ViewBag.login == true) {
@using Microsoft.AspNet.Identity
@if (ViewBag.login == true)
{
using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" }))
{
<div class="Logoutapp" ng-app="Logoutapp" ng-controller="AccountController">
<ul class="dropdown-menu">
<li>
@Html.ActionLink("Hello " + @Session["User"] + " !", "Index", "Manage", routeValues: null, htmlAttributes: new { title = "Manage" })
</li>
<li>
<a ng-click="logout()">{{btntext}}</a>
</li>
</ul>
<script src="~/Scripts/angular.js"></script>
<script src="~/Scripts/Angular Scripts/LoginJS/Logout.js"></script>
<script src="~/js/bootstrap.js"></script>
</div>
}
}
else
{
<ul class="dropdown-menu">
<li>@Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })</li>
<li>@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })</li>
</ul>
}
@使用Microsoft.AspNet.Identity
@如果(ViewBag.login==true)
{
使用(Html.BeginForm(“注销”、“帐户”、FormMethod.Post、新的{id=“logoutForm”、@class=“navbar right”}))
{
-
@ActionLink(“Hello”+@Session[“User”]+”!,“Index”,“Manage”,routeValue:null,htmlAttributes:new{title=“Manage”})
-
-
@*
*@
@Html.Partial(“_LoginPartial”)
@*
*@
-
-
@ActionLink(“帮助”、“帮助”、“主页”)
登录前下拉列表
<!-- header -->
<div class="header">
<div class="w3ls-header">
<!--header-one-->
<div class="w3ls-header-left">
<p><a href="#">UPTO 2000₹ OFF ON LAPTOPS | USE COUPON CODE LAPPY </a></p>
</div>
<div class="w3ls-header-right">
<ul>
<li class="dropdown head-dpdn">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user" aria-hidden="true"></i> My Account<span class="caret"></span></a>
@*<ul class="dropdown-menu">*@
@Html.Partial("_LoginPartial")
@*</ul>*@
</li>
<li class="dropdown head-dpdn">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-percent" aria-hidden="true"></i> Today's Deals<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="offers.html">Cash Back Offers</a></li>
<li><a href="offers.html">Product Discounts</a></li>
<li><a href="offers.html">Special Offers</a></li>
</ul>
</li>
<li class="dropdown head-dpdn">
@Html.ActionLink("Help", "Help", "Home")
</li>
</ul>
</div>
<div class="clearfix"> </div>
</div>