Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - problems with using LoginStatus on master page

 
Thread Tools Search this Thread
Old 08-02-2006, 06:20 PM   #1
Default problems with using LoginStatus on master page


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
  Reply With Quote
Old 08-02-2006, 08:15 PM   #2
Jeff
 
Posts: n/a
Default CASE SOLVED

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
>



  Reply With Quote
Old 08-02-2006, 08:19 PM   #3
=?Utf-8?B?YnJpYW5zW01DU0Rd?=
 
Posts: n/a
Default 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:

> 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
>
>
>

  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump