Sign Out before User Controls are added?

A

Adam Knight

Hi all,

I have a logout page that contains among other things a header user control.
This control displays the required navigation based upon whether the user is
logged in or not.

What i am trying to do is log a user out and have the navigation dissappear
also.

I have tried issuing the FormsAuthentication.SignOut from
Page_Load,Page_Init() in the hope
the user is logged out before the header control is added in the page. This
obviously isn't the case
as the navigation appears until i refresh the page.

What event or how do i go about logging the user out before the page is
rendered ect..

Current Code:
<%@ Page Language="vb"%>
<%@ Register TagPrefix="?" TagName="footer" Src="../footers/footer.ascx" %>
<%@ Register TagPrefix="?" TagName="header" Src="../headers/header.ascx" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Web.Security" %>
<script runat="server">

Private Sub Page_Init()

'sign user out of application.
FormsAuthentication.SignOut()

End Sub

</script>
 

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,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top