how to disable back Button in IE using asp.net
-
I use the following code to disable back in IE In javascript i use window.history.forward(1); ] and on code side protected void Page_Init(object sender, EventArgs e) { Response.Cache.SetCacheability(HttpCacheability.NoCache); } protected void Page_Load(object sender, EventArgs e) { Response.AddHeader("pragma", "no-cache"); Response.Expires = -1; } But When i move from login page to firstpage it should not retun to login page when the back button is clicked. right now its returning to login page.How can i avoid that.
-
I use the following code to disable back in IE In javascript i use window.history.forward(1); ] and on code side protected void Page_Init(object sender, EventArgs e) { Response.Cache.SetCacheability(HttpCacheability.NoCache); } protected void Page_Load(object sender, EventArgs e) { Response.AddHeader("pragma", "no-cache"); Response.Expires = -1; } But When i move from login page to firstpage it should not retun to login page when the back button is clicked. right now its returning to login page.How can i avoid that.
Good grief - did you search in codeproject prior to posting. This has to be the most asked question in this forum. Scroll down a few days, it'll be here somewhere... In fact, here, it's on the next page: http://www.codeproject.com/script/Forums/View.aspx?fid=12076&msg=2896781[^]
-
I use the following code to disable back in IE In javascript i use window.history.forward(1); ] and on code side protected void Page_Init(object sender, EventArgs e) { Response.Cache.SetCacheability(HttpCacheability.NoCache); } protected void Page_Load(object sender, EventArgs e) { Response.AddHeader("pragma", "no-cache"); Response.Expires = -1; } But When i move from login page to firstpage it should not retun to login page when the back button is clicked. right now its returning to login page.How can i avoid that.
Hi,Try to go through the following link. http://dotnetslackers.com/articles/ajax/HandlingTheBackButtonFromServerCode.aspx hope it helps.