Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
183
rated 0 times [  190] [ 7]  / answers: 1 / hits: 85993  / 15 Years ago, mon, december 7, 2009, 12:00:00

How to detect/track/check postback in javascript(e.g in asp.net Page.isPostBack())?
Any suggestion?


More From » asp.net

 Answers
17

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.


[#98133] Thursday, December 3, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
magdalena

Total Points: 364
Total Questions: 101
Total Answers: 92

Location: Namibia
Member since Mon, Nov 14, 2022
2 Years ago
;