ASP.NET Webforms: Detect postback on client-side

As JavaScript has no concept of postback, one way to achieve this would as follows:

VB backend code (on Page_Load)

ScriptManager.RegisterStartupScript(Me, Me.GetType(), "isPostBack", String.Format("var isPostback = {0};", IsPostBack.ToString().ToLower()), True)

 

Javascript frontend (I put it under doc ready)

$(document).ready(function () {
   if(isPostback) {
        // Postback specific logic here
    }
);}