在C#中接受Javascript确认框的返回值

时间:2014-02-28 09:24:21

标签: c# javascript

我必须在c#的代码隐藏中从javascript Confirm Popupbox获取值 这是我的代码。我可以使用此

显示弹出框
if (data.certFileName != CommonVariables.certfile || data.dataFileName != CommonVariables.datafile)
{
    string msg = "You have changed Arrival Filenames. Press OK To regenerate Autosys File. Press Cancel to Update the existing Autosys file";
    string script = "<script type=\"text/javascript\">confirm('" + msg + "');</script>";
    ClientScript.RegisterClientScriptBlock(this.GetType(), "ConfirmMsg", script);
}

我如何接受这个价值?

请帮忙。

1 个答案:

答案 0 :(得分:0)

if (data.certFileName != CommonVariables.certfile || data.dataFileName != CommonVariables.datafile)
{
    string msg = "You have changed Arrival Filenames. Press OK To regenerate Autosys File. Press Cancel to Update the existing Autosys file";
    string script = "<script type=\"text/javascript\">return confirm('" + msg + "');</script>";
    ClientScript.RegisterClientScriptBlock(this.GetType(), "ConfirmMsg", script);
}

你忘了写回程