problems with using LoginStatus on master page

J

Jeff

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
 
J

Jeff

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
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top