I would just put a rendering tag in javascript
var isPostBack = <%= Page.IsPostBack ? "true" : "false" %>;
Putting "true" and "false" as strings should be done to eliminate any possible problems associated with converting a type to a string, as in C # true. ToString () is usually "True", which is a javascript error.
source
share