This is my script :
<%
if (TempData["Resultat"] != null){
%>
<script type="text/javascript">
alert('<%: TempData["Resultat"]%>');
</script>
<%
}
%>
In this case pop-up is shown before page loaded, but i want that’s appear after page is fully loaded.
in Html it’s looks like this :
<body onload="happycode() ;">
but i can’t use it in MVC i got one master page for all my web application
If you can use jquery then you can put the alert inside the
$(document).ready()function. it would look something like this:To include jQuery, include the following in the
<head>tag of your code:Here’s a quick example in jsFiddle: http://jsfiddle.net/ChaseWest/3AaAx/