SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Jan 2009
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to hide the navigation back button

    how to invisible the navigation back button.
    I want to hide the navigation back button after clicking on logout.
    how to do this. wt to write for this?

  2. #2
    SitePoint Mentor NightStalker-DNS's Avatar
    Join Date
    Jul 2004
    Location
    Cape Town, South Africa
    Posts
    2,880
    Mentioned
    48 Post(s)
    Tagged
    0 Thread(s)
    If you are talking about the browser back button, that is not possible. Y would you want to do that anyway?

    And if it was possible. It would be JS related. Server side code will diff not work for this

  3. #3
    SitePoint Addict kunalraj's Avatar
    Join Date
    Nov 2008
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,


    Why you want to hide back button.

    you can do it by write some code on the page.
    Means when user logout then it should not go to back page.

    For that you have to write this code on every page`s page Load event where you have put logout link.

    Code:
    Response.AddHeader("Cache-Control","no-store");
    Response.AddHeader("Pragma","no-store");
    Response.AddHeader("Cache-Control","no-cache");
    
    if(Session["user"]==null)//user is username(session) which is i have created when user successfully login to system. change as per your req.
    {
       Response.Redirect("Home.aspx");//Home.aspx page login page. Change as per your req.
    }
    and on logout link click event you have to write

    Code:
    Session.Abandon();
    Session.Clear();
    Response.Redirect("Home.aspx");

    Write above code and read comments carefully.

    It will solve your problem.


    thanks,
    kunalraj


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •