ASP.net Site.master

时间:2017-03-09 07:08:05

标签: html asp.net

我在尝试运行网页时遇到错误“此上下文不支持代码块”

我在site.master中使用此代码

<asp:LoginView runat="server" ViewStateMode="Disabled">
    <AnonymousTemplate>
        <ul class="nav navbar-nav navbar-right">
            <li><a runat="server" href="~/Account/Register">Register</a></li>
            <li><a runat="server" href="~/Account/Login">Log in</a></li>
        </ul>
    </AnonymousTemplate>
    <LoggedInTemplate>
        <ul class="nav navbar-nav navbar-right">
            <li><a runat="server" href="~/Account/Manage" title="Manage your account">Hello, <%: Context.User.Identity.GetUserName()  %> !</a></li>
            <li>
                <asp:LoginStatus runat="server" LogoutAction="Redirect" LogoutText="Log off" LogoutPageUrl="~/" OnLoggingOut="Unnamed_LoggingOut" />
            </li>
        </ul>`enter code here`
    </LoggedInTemplate>
</asp:LoginView>

0 个答案:

没有答案