Initialize value of
submitButtonStatus
in
Page_Load()
event and then place it inside
!IsPostBack
condition.
Edit:- Try it as below.
static bool submitButtonStatus;
private void Page_Load()
{
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
if (pnlResults.Visible == true)
{
ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "Message", "alert('Please click on next button')", true);
}
SubmitButtonStatus = true;
}