1. Using javascript function we can able to reload part of the page. online window load we are loading startInterval function. we are reloading ShowingTime divison on every 5 seconds.
Javascript Code:
<script type="text/javascript"> window.onload = setInterval; //loading startInterval method onload. function setInterval() { setInterval("startTime();", 5000); //for every seconds this will refresh. } function setTime() { document.getElementById('ShowingTime').innerHTML = Date(); //changing present date based on time for every refresh. } </script>
HTML or ASP.NET Code
<div id="ranga"> <img src="sample.jpg" alt="ranga" /> <div id="ShowingTime"> this part will refresh on every 5 seconds. </div> </div>
2. Using JQuery we can able to refresh or reload part of page.
Javascript Code:
<script type="text/javascript"> window.onload = setReload; function setReload() { setInterval("reloadDivision();", 5000); } function reloadDivision() { $('#ReloadBlock').load("JQueryReload.aspx"); document.getElementById('ReloadBlock').innerHTML = Date(); } </script>
HTML or ASP.NET Code
<div id="ranga"> <img src="sample.jpg" alt="ranga" /> <div id="ReloadBlock"> this part will refresh on every 5 seconds. </div> </div>
+ comments + 1 comments
That is great.Thanks for contributing...
Post a Comment
Please give your valuable feedback on this post. You can submit any ASP.NET article here. We will post that article in this website by your name.