hi!
i am using this line (code is write under form load)
Page.RegisterClientScriptBlock("", "");
using this when i click logout button in my form i am goto log in page and click back arrow button of web browser it display login page. its working and its fine. my aim is also when i logout then goto login page.
but my problem is i worked another pages of project if i click back arrow button of web browser. it is not go to back page it still on that page only. it is inconvenience for me.
my aim is when i click back arrow button of web browser it goes to back page but if i click logout button when i click back arrow button of web browser, it display only Login page.
please give a code of this doing.
Thanks
Loading
ArshadPosted Apr 25, 2010, 5:08 PM
I got it what you need.
First you comment the below line in your code.
Page.RegisterClientScriptBlock("", "");
At the Log Off event you call Abondon method and clear method of Session.
And in all the Load event of your aspx.cs page add the below code.
Response.Cache.SetCacheability[HttpCacheability.NoCache]
Response.Cache.SetExpires[Now]
//In the second line 'Now' workes fine with the Vb.Net, in C# you use DatTime.Now. Please check it once i am not too sure about that.
This will work. Its because of cahe, when you will do the log off it comes to the Login page and agian if you press the back button it does go to the previous page, because the browser gets catch the page. we have clear first. These two lines is enough
Regards,
Dipa AhujaPosted Apr 24, 2010, 12:55 PM