Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

Logout login_view

$
0
0

My user is logged in and the login view shows Logout. WHen I click Logout does it automatically log you out? At that time I am displaying a modalpopup giving them the option to logout, but it seems that the control has already changed to login?  I there a way to get around that?

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"><div style="clear:both;" /><div class="mypages"><div style="width:300px; margin:auto;"><asp:Panel ID="Panel1" runat="server" CssClass="gainsPanel"><div style="width:250px;"><img alt="" src="../Images/Icons/logout.png" />  <h2>Log Out?</h2>Logging out will clear your credentials and you will have to login when you visit next.<asp:Button ID="Button1" runat="server" Text="OK" OnClick="Button1_Click" />&nbsp;<asp:Button ID="Button2" runat="server" Text="Cancel" OnClick="Button2_Click"  /></div></asp:Panel><ajaxToolkit:ModalPopupExtender ID="Panel1_ModalPopupExtender" runat="server"  Enabled="True" TargetControlID="Button3"  PopupControlID="Panel1" OkControlID="Button1" BackgroundCssClass="modalBackground" /><asp:Button ID="Button3" runat="server" Text="Button" style="display:none;" /></div></div><div style="clear:both;" /></asp:Content>
public partial class Main_logout : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Panel1_ModalPopupExtender.Show();
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        FormsAuthentication.SignOut();
        Response.Redirect("~/Main/Main.aspx");
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/Main/Main.aspx");
    }
}




Viewing all articles
Browse latest Browse all 4737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>