0

I am Passing TempDatamessage to use if user login invalid login deatails i passing message "login invalid" tempdata.i just need to hide with 5 sec automatically without refresh.

         TempData["mesage"] = "Your User Id Is Not Activated, Please 
         Contact Our Support";

How to hide the message

in the view Page I am Passing

     <script type="text/javascript">
       function HideLabel() {
       setTimeout(function() {
        $('#msg1').fadeOut('fast');
        }, 1000); 
     </script>
     <div class="cornerpage">
        <h8 >@TempData["mesage"]</h8>
        <h8 id="msg1">@TempData["mesage1"]</h8>

       </div>
Ashiquzzaman
  • 5,129
  • 3
  • 27
  • 38

1 Answers1

1

You need to call javascript after document ready.

Example:

<div class="cornerpage">       
   <h8 id='message'>@TempData["message"]</h8>
 </div>


 <script type="text/javascript">
 $(function(){
   $('#message').hide(1000);
 });
 </script>

please see this like for more help.

Hopefully it's helpful for you.

Ashiquzzaman
  • 5,129
  • 3
  • 27
  • 38