I want to implement javascript confirm box from code behind.
My requirement is in a method I need to raise a confirm box ,based on the result I need to implement diff functionalites
For Example;
if OK of Confirm Box the add Tax
if cancel Then do not add tax
I am trying something like this but its not helping me
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "confirm", "confirm('Add tax');", true);
Can anyone help.
my sample Code is
protected void Button1_Click(object sender, EventArgs e)
{
Double mrp = 200.00;
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "confirm", "return confirm('Add Tax');", true);
if (Confirm == "Ok")
{
//Add tax to mrp
}
else
{
//No tax for mrp
}
}
Thank You..