![]() |
|
|
|||||||
![]() |
ASP Net - problems with using LoginStatus on master page |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
hey
asp.net 2.0 I've placed a LoginStatus control on a master page (so I don't need to have it on every webpage) in my project. When I click on this control to logout, I get this error: A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll An exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll but was not handled in user code A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll An exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll but was not handled in user code The program '[3188] WebDev.WebServer.EXE: Managed' has exited with code 0 (0x0). This is part of my web.config. <authentication mode="Forms"> <forms loginUrl ="Default.aspx"/> </authentication > This is my LoginStatus control inside my master page: <asp:LoginStatus ID="LoginStatus1" runat="server" /> Any suggestions on how to solve this is very welcome! I would prefer to use the LoginStatus control on the master page. Placing on the webpage means I would have to go through every webpage in my project and add a LoginStatus control to it... If this is not possible, maybe this could help: Instead of using the LoginStatus control to logout user, write a method that do the outlogging.... I'm not sure if it's possiple... - Then I could call this method from a MenuItem any suggestions? Jeff Jeff |
|
|
|
|
#2 |
|
Posts: n/a
|
CASE SOLVED
Instead of using a LoginStatus control I created a webpage (logout.aspx) and placed this code in its Page_Load event: FormsAuthentication.SignOut(); FormsAuthentication.RedirectToLoginPage(); This is the only source I have in the page (of course in addition to the code behind): <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Logout.aspx.cs" Inherits="Logout" %> I post this just in case somebody else may find this info usefull Jeff "Jeff" <> wrote in message news:%... > hey > > asp.net 2.0 > > I've placed a LoginStatus control on a master page (so I don't need to > have it on every webpage) in my project. When I click on this control to > logout, I get this error: > A first chance exception of type 'System.Threading.ThreadAbortException' > occurred in mscorlib.dll > An exception of type 'System.Threading.ThreadAbortException' occurred in > mscorlib.dll but was not handled in user code > A first chance exception of type 'System.Threading.ThreadAbortException' > occurred in mscorlib.dll > An exception of type 'System.Threading.ThreadAbortException' occurred in > mscorlib.dll but was not handled in user code > The program '[3188] WebDev.WebServer.EXE: Managed' has exited with code 0 > (0x0). > > This is part of my web.config. > <authentication mode="Forms"> > <forms loginUrl ="Default.aspx"/> > </authentication > > > > This is my LoginStatus control inside my master page: > <asp:LoginStatus ID="LoginStatus1" runat="server" /> > > > Any suggestions on how to solve this is very welcome! I would prefer to > use the LoginStatus control on the master page. Placing on the webpage > means I would have to go through every webpage in my project and add a > LoginStatus control to it... > > If this is not possible, maybe this could help: > Instead of using the LoginStatus control to logout user, write a method > that do the outlogging.... I'm not sure if it's possiple... - Then I could > call this method from a MenuItem > > any suggestions? > > > Jeff > |
|
|
|
#3 |
|
Posts: n/a
|
Hello Jeff,
I have a couple of websites which work the same way which you're proposing - login status control on masterpage, etc. None of them experience the exception you're seeing. Are you sure it's on the logout? How I might look at it would be to put an event handler for the LoggingOut and the LoggedOut events, then step through the code and make sure that the exception is thrown somewhere between when the user is about to logout (the LoggingOut event) and is actually logged out (the LoggedOut event). If the exception occurs somewhere outside of these two events, you know it's not the logging out action which is throwing the exception. But instead, some other ancillary action. If the exception is thrown between these two events then I doubt putting the login status controls on separate pages will help because there is a problem with the MembershipProvider and it would need further debugging. Hope this makes sense. -- brians http://www.limbertech.com "Jeff" wrote: > hey > > asp.net 2.0 > > I've placed a LoginStatus control on a master page (so I don't need to have > it on every webpage) in my project. When I click on this control to logout, > I get this error: > A first chance exception of type 'System.Threading.ThreadAbortException' > occurred in mscorlib.dll > An exception of type 'System.Threading.ThreadAbortException' occurred in > mscorlib.dll but was not handled in user code > A first chance exception of type 'System.Threading.ThreadAbortException' > occurred in mscorlib.dll > An exception of type 'System.Threading.ThreadAbortException' occurred in > mscorlib.dll but was not handled in user code > The program '[3188] WebDev.WebServer.EXE: Managed' has exited with code 0 > (0x0). > > This is part of my web.config. > <authentication mode="Forms"> > <forms loginUrl ="Default.aspx"/> > </authentication > > > > This is my LoginStatus control inside my master page: > <asp:LoginStatus ID="LoginStatus1" runat="server" /> > > > Any suggestions on how to solve this is very welcome! I would prefer to use > the LoginStatus control on the master page. Placing on the webpage means I > would have to go through every webpage in my project and add a LoginStatus > control to it... > > If this is not possible, maybe this could help: > Instead of using the LoginStatus control to logout user, write a method that > do the outlogging.... I'm not sure if it's possiple... - Then I could call > this method from a MenuItem > > any suggestions? > > > Jeff > > > |
|