Got new domain name for my blog. So, moving this to justgagan.com. 🙂
Category Archives: Uncategorized
The speech by Steve Jobs at Standford’s in 2005 : Highly Motivational
- Never stop on hurdles, it leads us to match dots when we look back to our life.
- Love your work, and
- Send positive energy to others and it also returned back to you.
Scroll back to page start after Asyncronous postback(multiple update panels)
I have multiple update panels in User controls and it cause page to go to start after each asynchronous postback. By adding this code, I am able to handle the Problem I am facing.
the code in script tag is:
var xpos, ypos;
function windowScroll() {
xpos = document.body.parentNode.scrollLeft; //window.scrollX is not compatible with IE 6
ypos = document.body.parentNode.scrollTop; //window.scrollY is not compatible with IE 6
}
function pageLoaded(sender, args) {
window.scrollTo(xpos, ypos);
}
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(pageLoaded);
window.onscroll = windowScroll;
Adding this code in body section in the end because ‘Sys’ must have to defined before using this code.