I have an approve button.on clicking on this button it should show that an inactive value is present .Onclicking yes conformation it should save the data or else clicking on no conformation should return false; how i will do that?After alert it always submit the data.
protected void ibtApprove_Click(object sender, ImageClickEventArgs e)
{
string otherAffiliateName = txtRequestedAffiliate.Text;
int inActiveAffiliates = new BLRating().InActiveAAffiliateChecking(otherAffiliateName);
if (inActiveAffiliates > 0)
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "confirm('Do you want to approve application which contains in active affiliate?');", true);
}
int intSuccess = new BLRating().ApproveApplication(intAppNo, Session["UserId"].ToString());
if (intSuccess > 0)
{
Hashtable htLog = new Hashtable();
htLog["AppNo"] = intAppNo.ToString();
htLog["ActivityLogId"] = "28";
htLog["Description"] = "Application BMO -" + intAppNo + " Approved";
htLog["UserId"] = Session["UserId"].ToString();
htLog["Status"] = hdnStatus.Value.ToString();
new BLLogDetails().InsertLogDetails(htLog);
Page.RegisterStartupScript("alert", "<script>Reload()</script>");
}
}
<asp:ImageButton ID="ibtApprove" align="absmiddle" runat="server" ImageUrl="~/Images/btn_Approve.gif"
ToolTip="Approve" OnClick="ibtApprove_Click" Style="height: 18px; display: none">
</asp:ImageButton>
This is the code i used.how i wiil stay back on Confirm
'no' click?