Connecting Tech Pros Worldwide Help | Site Map

problems with using LoginStatus on master page

  #1  
Old August 2nd, 2006, 07:15 PM
Jeff
Guest
 
Posts: n/a
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


  #2  
Old August 2nd, 2006, 09:15 PM
Jeff
Guest
 
Posts: n/a

re: problems with using LoginStatus on master page


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" <it_consultant1@hotmail.com.NOSPAMwrote in message
news:%23jhd4AmtGHA.1808@TK2MSFTNGP06.phx.gbl...
Quote:
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  
Old August 2nd, 2006, 09:15 PM
brians[MCSD]
Guest
 
Posts: n/a

re: problems with using LoginStatus on master page


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:
Quote:
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
>
>
>
Closed Thread