检查后面的代码中的javascript确认

时间:2013-03-18 07:16:42

标签: c# javascript asp.net c#-4.0

我使用以下脚本显示确认消息框。我想要最高检查确认状态是否可以。我怎么检查这个?

ScriptManager.RegisterStartupScript(this, this.GetType(), "temp", "<script language='Javascript'>confirm('ERROR ALERT : " + status + " You can not create record for the above list! Do you want to proceed ?');</script>", false);

1 个答案:

答案 0 :(得分:0)

确认返回布尔值(true or false),您可以将其分配给变量,详细了解确认here

ScriptManager.RegisterStartupScript(this, this.GetType(), "temp", "<script language='Javascript'>result = confirm('ERROR ALERT : " + status + " You can not create record for the above list! Do you want to proceed ?');</script>", false);