我有一個asp.net的web應用程序,它允許用戶登錄和註銷。當用戶登錄時(沒問題),它說歡迎用戶名,這很好。但在它旁邊還是說登錄。任何人都可以幫助我有一些財產,我需要設置登錄?謝謝你的幫助。Asp.net登錄狀態不說用戶登錄後註銷
<asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false">
<AnonymousTemplate>
[ <a href="~/Account/Login.aspx" id="HeadLoginStatus" runat="server">Log In</a>
]
</AnonymousTemplate>
<LoggedInTemplate>
<span class="bold">Welcome</span><span class="bold">
<asp:LoginName ID="HeadLoginName" runat="server" />
</span>! [
<asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out"
LogoutPageUrl="~/" />
]
</LoggedInTemplate>
</asp:LoginView>
protected void LoginUser_Authenticate(object sender, AuthenticateEventArgs e)
{
SqlHelper userLogin = new SqlHelper();
TextBox User = (TextBox) LoginUser.FindControl("UserName");
TextBox Password = (TextBox) LoginUser.FindControl("Password");
bool results = userLogin.UserLogin(User.Text, Password.Text);
e.Authenticated = results;
}
我沒有碰到任何視覺工作室提供的默認設置。 – user516883
你可以嘗試改變我提到的兩件事,看看它是否有任何區別? –
試過他們兩個,但什麼都沒有。 – user516883