Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Logout problem

Logout problem

Scheduled Pinned Locked Moved ASP.NET
csharphelpasp-netdatabasequestion
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Purish Dwivedi
    wrote on last edited by
    #1

    I am using MS-ACCESS with ASP.NET & C#. To maintain the session my code is. if (ds.Tables[0].Rows.Count > 0) { Session["SUBSCRIBER_USERNAME"] = Login1.UserName; Session["SUBSCRIBER_PASSWORD"] = Login1.Password; } else { Response.Redirect("index.aspx"); } I have 3 other pages in my web application. I have a logout button on all the 3 pages onwhich I want to apply logout coding. How can it be done? Please help. Thanks.

    P S C 3 Replies Last reply
    0
    • P Purish Dwivedi

      I am using MS-ACCESS with ASP.NET & C#. To maintain the session my code is. if (ds.Tables[0].Rows.Count > 0) { Session["SUBSCRIBER_USERNAME"] = Login1.UserName; Session["SUBSCRIBER_PASSWORD"] = Login1.Password; } else { Response.Redirect("index.aspx"); } I have 3 other pages in my web application. I have a logout button on all the 3 pages onwhich I want to apply logout coding. How can it be done? Please help. Thanks.

      P Offline
      P Offline
      padmanabhan N
      wrote on last edited by
      #2

      Purish Dwivedi wrote:

      have a logout button on all the 3 pages onwhich I want to apply logout coding

      you can use Session.Abandon(); in each of the button click

      Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]

      P 1 Reply Last reply
      0
      • P Purish Dwivedi

        I am using MS-ACCESS with ASP.NET & C#. To maintain the session my code is. if (ds.Tables[0].Rows.Count > 0) { Session["SUBSCRIBER_USERNAME"] = Login1.UserName; Session["SUBSCRIBER_PASSWORD"] = Login1.Password; } else { Response.Redirect("index.aspx"); } I have 3 other pages in my web application. I have a logout button on all the 3 pages onwhich I want to apply logout coding. How can it be done? Please help. Thanks.

        S Offline
        S Offline
        sashidhar
        wrote on last edited by
        #3

        You Can Use Many Number of ways..!

        Session.RemoveAll();

        Session.Abandon();

        LatestArticle :Log4Net Why Do Some People Forget To Mark as Answer .If It Helps.

        1 Reply Last reply
        0
        • P padmanabhan N

          Purish Dwivedi wrote:

          have a logout button on all the 3 pages onwhich I want to apply logout coding

          you can use Session.Abandon(); in each of the button click

          Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]

          P Offline
          P Offline
          Purish Dwivedi
          wrote on last edited by
          #4

          Thanks for the reply. My problem is that: I am maintaining session only in first page(login page). How can I maintain it in other pages? Plz help..

          P 1 Reply Last reply
          0
          • P Purish Dwivedi

            Thanks for the reply. My problem is that: I am maintaining session only in first page(login page). How can I maintain it in other pages? Plz help..

            P Offline
            P Offline
            padmanabhan N
            wrote on last edited by
            #5

            you can use a label and maintain the user in that label.... or if you dont want to show the user to others you can maintain it via hiddenfield or some string........

            Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]

            1 Reply Last reply
            0
            • P Purish Dwivedi

              I am using MS-ACCESS with ASP.NET & C#. To maintain the session my code is. if (ds.Tables[0].Rows.Count > 0) { Session["SUBSCRIBER_USERNAME"] = Login1.UserName; Session["SUBSCRIBER_PASSWORD"] = Login1.Password; } else { Response.Redirect("index.aspx"); } I have 3 other pages in my web application. I have a logout button on all the 3 pages onwhich I want to apply logout coding. How can it be done? Please help. Thanks.

              C Offline
              C Offline
              carlecomm
              wrote on last edited by
              #6

              Hi, you can use a master page and put your logout button in the master page's header. The session remove: Session.RemoveAll(); or Session.Abandon();

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups