Wrox Programmer Forums
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 20th, 2006, 09:21 AM
Authorized User
 
Join Date: Oct 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Urgent!! need help...Logout problems

Hello,
I am working on a project in Visual Studio 2003 that consists of two applications one is in VB and the other is in C#. When a user login a cookie is created and used by the second application (C#). The problem is that if I want to login under a different ID & password than I have to manually delete the cookies (go to IE-option-delete cookies/cache) and than only can I login as a different user without closing the IE. What I am doing to fix the problem is by linking a LOGOUT hyperlink to a new page (LogoutPage.aspx) that has the following code:-
(Language C#)
namespace SubmissionClearance
{
public class LogoutPage : System.Web.UI.Page
    {
        private void Page_Load(object sender, System.EventArgs e)
        {
            FormsAuthentication.SignOut();
            Response.Redirect("../Agents/FormsLogin.aspx",true);
        }

    }
}
(Language VB)
Public Class LogoutPage
    Inherits System.Web.UI.Page
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            FormsAuthentication.SignOut()
            Response.Redirect("~/Agents/FormsLogin.aspx", True)
        End Sub

End Class
(here is the code (HTML) for the hyperlink to link to logout page)
<A runat="server" class="leftMainLinkCell" onmouseover="return overlib('Click here to Logout.')" onmouseout="nd();" href="~/Agents/LogoutPage.aspx">Logout</A>
But I am getting an error: something saying that namespace name FormsAuthentication…?
I also added <%@ Import Namespace = "System.Web.Security"%> but still get the error
I was wondering if this is the right way to do it or is there a better way?
(Note: I was searching online and read that it is better to use page_load event than button_click)
Thanks a lot…for yr time & help…appreciate it!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Asp.net Logout problems hemal_301080 ASP.NET 1.0 and 1.1 Professional 1 August 6th, 2006 12:16 PM
Urgent rec navigation problems shelbygt22 Access VBA 1 March 18th, 2005 12:59 PM
logout TIME and logout DATE crmpicco Classic ASP Databases 2 January 20th, 2005 12:01 AM
logout TIME and logout DATE crmpicco Classic ASP Basics 0 January 19th, 2005 07:57 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.