I would like to show popup message if there is an error on the page but somehow jquery doesn't show anything.
 <script>
     $(document).ready(function () {
         if(@TempData["Error"].ToString() != null)
         {
             alert("Message 1");
         } else {
             alert("Message 2");
         }
    });
 </script>