closing a website

Discussion in 'ASP .Net' started by JohnE, Dec 29, 2009.

  1. JohnE

    JohnE Guest

    I have a masterpage that has a hyperlink in the header titled 'Log Out'. The
    intent is to have the user select this and it would end all sessions for all
    apps that were open and go back to the log in screen. I was looking at using
    the following 2 lines to accomplish this.

    Session.Abandon();
    Response.Redirect("LogIn.aspx");

    But, it seems that these are causing havoc when I go to run the website. By
    havoc, I mean the website does not want to load. Either the 2 lines are not
    correct or I am putting them in the wrong place.

    Is there a better way to close it all down than these 2 lines? If these 2
    lines are okay then where are they placed?

    Thanks...John
     
    JohnE, Dec 29, 2009
    #1
    1. Advertising

  2. JohnE

    Rob Hill Guest

    Are you putting these in the LinkButton_Click method or the Page_Load?

    I could see this causing problems in the Page_Load.

    Rob

    "JohnE" <> wrote in message news:...
    >I have a masterpage that has a hyperlink in the header titled 'Log Out'. The
    > intent is to have the user select this and it would end all sessions for all
    > apps that were open and go back to the log in screen. I was looking at using
    > the following 2 lines to accomplish this.
    >
    > Session.Abandon();
    > Response.Redirect("LogIn.aspx");
    >
    > But, it seems that these are causing havoc when I go to run the website. By
    > havoc, I mean the website does not want to load. Either the 2 lines are not
    > correct or I am putting them in the wrong place.
    >
    > Is there a better way to close it all down than these 2 lines? If these 2
    > lines are okay then where are they placed?
    >
    > Thanks...John
     
    Rob Hill, Dec 29, 2009
    #2
    1. Advertising

  3. JohnE

    JohnE Guest

    I've tried both ways and it is not working. I noticed that a hyperlink in a
    masterpage doesn't show any click event when it is double clicked on.



    "Rob Hill" wrote:

    > Are you putting these in the LinkButton_Click method or the Page_Load?
    >
    > I could see this causing problems in the Page_Load.
    >
    > Rob
    >
    > "JohnE" <> wrote in message news:...
    > >I have a masterpage that has a hyperlink in the header titled 'Log Out'. The
    > > intent is to have the user select this and it would end all sessions for all
    > > apps that were open and go back to the log in screen. I was looking at using
    > > the following 2 lines to accomplish this.
    > >
    > > Session.Abandon();
    > > Response.Redirect("LogIn.aspx");
    > >
    > > But, it seems that these are causing havoc when I go to run the website. By
    > > havoc, I mean the website does not want to load. Either the 2 lines are not
    > > correct or I am putting them in the wrong place.
    > >
    > > Is there a better way to close it all down than these 2 lines? If these 2
    > > lines are okay then where are they placed?
    > >
    > > Thanks...John
     
    JohnE, Dec 29, 2009
    #3
  4. JohnE

    Rob Hill Guest

    Don't use a hyperlink, use a linkbutton.

    "JohnE" <> wrote in message
    news:...
    > I've tried both ways and it is not working. I noticed that a hyperlink in
    > a
    > masterpage doesn't show any click event when it is double clicked on.
    >
    >
    >
    > "Rob Hill" wrote:
    >
    >> Are you putting these in the LinkButton_Click method or the Page_Load?
    >>
    >> I could see this causing problems in the Page_Load.
    >>
    >> Rob
    >>
    >> "JohnE" <> wrote in message
    >> news:...
    >> >I have a masterpage that has a hyperlink in the header titled 'Log Out'.
    >> >The
    >> > intent is to have the user select this and it would end all sessions
    >> > for all
    >> > apps that were open and go back to the log in screen. I was looking at
    >> > using
    >> > the following 2 lines to accomplish this.
    >> >
    >> > Session.Abandon();
    >> > Response.Redirect("LogIn.aspx");
    >> >
    >> > But, it seems that these are causing havoc when I go to run the
    >> > website. By
    >> > havoc, I mean the website does not want to load. Either the 2 lines
    >> > are not
    >> > correct or I am putting them in the wrong place.
    >> >
    >> > Is there a better way to close it all down than these 2 lines? If
    >> > these 2
    >> > lines are okay then where are they placed?
    >> >
    >> > Thanks...John
     
    Rob Hill, Dec 30, 2009
    #4
  5. JohnE

    Abdul Sami Guest

    Use either linkButton to write this code on its click event.
    Or use hyperlink to navigate to login.aspx and onload event of login.aspx
    write down these two lines
    --
    Abdul Sami


    "JohnE" wrote:

    > I have a masterpage that has a hyperlink in the header titled 'Log Out'. The
    > intent is to have the user select this and it would end all sessions for all
    > apps that were open and go back to the log in screen. I was looking at using
    > the following 2 lines to accomplish this.
    >
    > Session.Abandon();
    > Response.Redirect("LogIn.aspx");
    >
    > But, it seems that these are causing havoc when I go to run the website. By
    > havoc, I mean the website does not want to load. Either the 2 lines are not
    > correct or I am putting them in the wrong place.
    >
    > Is there a better way to close it all down than these 2 lines? If these 2
    > lines are okay then where are they placed?
    >
    > Thanks...John
     
    Abdul Sami, Dec 30, 2009
    #5
  6. JohnE

    JohnE Guest

    I switched over to a linkbutton and got it to go to the LogOut.aspx page. It
    didn't want to work until I added an extra slash since the LogOut resides in
    a different folder. Oh, in my original post I meant LogOut, not Login.
    Looking, typing, and thinking were not synched.

    A question I do have is that when the LogOut is used with the 2 lines
    posted, I can return back by using the browser's back button. How do I end
    it all so if the users do use the back button (and I know some will), there
    is nothing to go back to?

    Thanks.
    .... john



    "Abdul Sami" wrote:

    > Use either linkButton to write this code on its click event.
    > Or use hyperlink to navigate to login.aspx and onload event of login.aspx
    > write down these two lines
    > --
    > Abdul Sami
    >
    >
    > "JohnE" wrote:
    >
    > > I have a masterpage that has a hyperlink in the header titled 'Log Out'. The
    > > intent is to have the user select this and it would end all sessions for all
    > > apps that were open and go back to the log in screen. I was looking at using
    > > the following 2 lines to accomplish this.
    > >
    > > Session.Abandon();
    > > Response.Redirect("LogIn.aspx");
    > >
    > > But, it seems that these are causing havoc when I go to run the website. By
    > > havoc, I mean the website does not want to load. Either the 2 lines are not
    > > correct or I am putting them in the wrong place.
    > >
    > > Is there a better way to close it all down than these 2 lines? If these 2
    > > lines are okay then where are they placed?
    > >
    > > Thanks...John
     
    JohnE, Dec 30, 2009
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Flip
    Replies:
    1
    Views:
    440
    Karl Seguin
    Nov 22, 2005
  2. Shawn

    Website on a website.

    Shawn, Jan 15, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    490
    Shawn
    Jan 15, 2006
  3. sck10
    Replies:
    1
    Views:
    423
    Michael Kolias
    Apr 13, 2006
  4. =?Utf-8?B?Vk1J?=

    Closing popup window when closing parent window?

    =?Utf-8?B?Vk1J?=, Feb 14, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    656
    Thomas Hansen
    Feb 15, 2007
  5. thomas
    Replies:
    0
    Views:
    229
    thomas
    Oct 23, 2003
Loading...

Share This Page