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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Iftikar HussainPosted Jul 29, 2013, 10:18 AM
Regards,
Iftikar
VijayPosted Jul 29, 2013, 10:12 AM
Posted Jul 29, 2013, 10:00 AM
Please let me know, when you want to show this alert box?
http://pratyushkrishna.blogspot.in/2012/11/mvc3-razor-jquery-client-side.html
Scott LyslePosted Jul 29, 2013, 9:53 AM
public ActionResult Contact(){
ViewBag.AlertMsg = "Scary things are happening - beware!"; return View();
}
<script type="text/javascript">
$(document).ready(function () {
alert('@ViewBag.AlertMsg');});
script>
Iftikar HussainPosted Jul 29, 2013, 9:51 AM
Iftikar