Hi,
I want to refresh a part of page ie iframe after particular duration.and even I want to maintain the scroll back position after refresh the iframe.
I don't want to use Update Panel I want to use pure javascript.
I tried this also (Meta to refresh and MaintainScrollPositionOnPostback )..but the scroll back position is maintained in Mozilla but not in IE..
I will just elaborate my scenario
In mainPage I have IFrame -> src = contentPage
In ContentPage I set Meta to refresh the page and I have set the MaintainScrollPositionOnPostback
I am not getting where I am wrong?
can anybody help me by code?
Loading
Rodick WuPosted May 28, 2009, 10:59 AM
Niradhip is right, you can use window.scrollTo function to set the position of scroll,
function SetDivPosition(){
var intY = document.getElementById("DivWithScroll").scrollTop;
document.cookie = "yPos=!~" + intY + "~!";
//add
window.scrollTo(0,intY);
}
Tejaswini Prashant JPosted May 28, 2009, 8:00 AM
plz go thru my code..
-- mainPage
=====================================
The InnerFramePage code :
========
I am assigning text to litMessages at runtime to get a scrollbar.
plz let me know where I am wrong?
Niradhip ChakrabortyPosted May 26, 2009, 1:13 PM
Maintain scrollback position should work. If it is not working then use javascript code do it. follow the following code:
Try this script to refresh a part of page ie iframe after particular duration
Following javascript function will refresh the iframe after certain amount of time
function refreshiframe()
{
parent.iframeid.location.href="thepage.com"
setTimeout("refreshiframe()", 1500000);
}
This script to scroll to the same position (use different parameters)