Hi,
Is it possible to use alert box in MVC controller.
Possible means how can declare? give syntax?
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 29, 2013, 5:51 AM EDT
Iftikar
Scott LysleRank #49 · 31K reputationPosted Jul 29, 2013, 5:53 AM EDT
public ActionResult Contact(){
ViewBag.AlertMsg = "Scary things are happening - beware!"; return View();
}
<script type="text/javascript">
$(document).ready(function () {
alert('@ViewBag.AlertMsg');});
script>
Posted Jul 29, 2013, 6:00 AM EDT
Please let me know, when you want to show this alert box?
http://pratyushkrishna.blogspot.in/2012/11/mvc3-razor-jquery-client-side.html
Vijay134 reputationPosted Jul 29, 2013, 6:12 AM EDT
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 29, 2013, 6:18 AM EDT
Regards,
Iftikar