简体   繁体   English

按下浏览器的后退按钮时的呼叫页面加载事件

[英]Call page load event on browser's back button press

I've written a function on page_load event of aspx page. 我已经在aspx页面的page_load事件上编写了一个函数。 Problem i'm facing is the function doesn't get call when browser's back button is pressed, or you can say page_load event is not fired. 我面临的问题是,当按下浏览器的后退按钮时,该函数无法调用,或者可以说未触发page_load事件。 I want to call this function whenever user press browser's back button. 我想在用户按下浏览器的后退按钮时调用此函数。 I've tried 我试过了

      HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);

but it didn't worked. 但是没有用。 Please help, thanks 请帮忙,谢谢

Set postback=true to controls. 将postback = true设置为控件。 After fetching the data, clear the controls text. 提取数据后,清除控件文本。 then proceed to next page. 然后进入下一页。 When user clicks "Back" button, the controls will be clear. 当用户单击“返回”按钮时,控件将被清除。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 按“后退浏览器”按钮,失去上一页状态 - Press the Back Browser button loosing the previous page state 为什么退出时会转到页面并在c#,mvc中按浏览器后退按钮 - why it goes to a page when signout and press browser back button in c#, mvc 如何通过单击另一页面的链接按钮来调用按钮的单击事件,而无需在c#ASP.NET中回发 - How to call button's click event from click of linkbutton of another page without post back in c# ASP.NET 即使按下键盘上的Enter键,如何调用按钮按下事件 - How to call a Button press Event even with the press of the Enter key on keyboard 如何在浏览器中按“后退”按钮重新输入AJAX请求? - How to re-input an AJAX request on press back button in the browser? 单击浏览器上的“后退”按钮时的Asp.Net Force Page_Load - Asp.Net Force Page_Load when Clicking Back Button On Browser 按浏览器后退按钮后无法读取页面加载时所选的下拉列表值 - Unable to read the selected drop down list value on page load after pressing browser back button 在浏览器上按回时页面不加载 - Page does not load when pressing back on browser 使浏览器的后退按钮上的特定页面过期 - Expire a particular page on back button of browser 清除浏览器后退按钮上的字段 - Clear fields on browser's back button
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM