如何在执行某些数学运算后在控制器中显示警报框。

时间:2013-12-18 14:05:08

标签: asp.net-mvc-4 alert

我想在Alert Box内执行一些数学运算后显示controller 我想把它编码到控制器中,但是怎么做......到现在为止我试过了:

return Content("<script language='javascript' type='text/javascript'>alert('Total of Debit and Credit balance does not Tally');</script>");
return JavaScript("<script>alert(\"some message\")</script>");
return JavaScript("<script>alert(\"some message\")</script>");
return Content("<script language='javascript' type='text/javascript'>alert('Hello world!');</script>");
return Content("<script language='javascript' type='text/javascript'>alert('Data Already Exists');</script>");
return RedirectToAction("");
ViewBag.DataExists = true;
return RedirectToAction("");

我试过的所有替代品......

1 个答案:

答案 0 :(得分:0)

尝试这样的事情:

return JavaScript(alert("Hello this is an Alert"));