How to detect/track/check postback in javascript(e.g in asp.net Page.isPostBack())? Any suggestion?
Postback is a mechanism where the page contents are posted to the server due to an occurrence of an event in a page control. For example, a server button click or a Selected Index changed event when AutoPostBack value is set to true.
PostBack is the name given to the process of submitting an ASP.NET page to the server for processing. PostBack is done if certain credentials of the page are to be checked against some sources (such as verification of username and password using database).
ASPX:
<input type="hidden" id="_ispostback" value="<%=Page.IsPostBack.ToString()%>" />
Client-side Script:
function isPostBack() { //function to check if page is a postback-ed one return document.getElementById('_ispostback').value == 'True'; }
PS: I have not tested it but I've done somthing similar before and it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With