Saloni
Saloni

Reputation: 527

How to refresh tab panel in MVC?

I m new to MVC. I need to refresh tab panel after 10 seconds in MVC. Can anybody help me in that?

Thanks

Upvotes: 1

Views: 810

Answers (2)

Abdallah
Abdallah

Reputation: 62

you can do that using JQuery or ajax the following is a sample example using Jquery

<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>

<script>
var refreshId = setInterval(function()
{
 $('#responsecontainer').fadeOut("slow").load('your target page will be    here').fadeIn("slow");
}, 100);
</script>
</head>
<body>

<div id="responsecontainer">
here you can place your Div,html or ASP.net control 
</div>
</body>
</head>
</html>

Upvotes: 1

Jason Goemaat
Jason Goemaat

Reputation: 29214

The div or whatever you use for content should have an id and should be rendered as an action that returns a partial view. Then you can use JavaScript to set the timer, and jquery Ajax call to replace the content with what is returned by calling the URL you get by URL.Action.

Upvotes: 0

Related Questions