I have a page with products and each product has a link: "Buy". After clicking the link, a popup will show up which will have inside another .aspx file embedded. (the popup is generated by Colorbox plugin)
After the user is making the purchase (clicking on the button that sends to the DB information and so on): 1. the popup has to close itself 2. the parent page has to be reloaded 3. the scroll position has to be maintained
The problem is that the scroll position is not maintained (especially in IE browser).
What I tried: 1.
MaintainScrollPositionOnPostback="true" -- had no effect
And:
Popup page:
<script>window.parent.callbackfromchild('" + ID + "');</script>
Parent page: function callbackfromchild(arg) {
__doPostBack("callbackbtn", "");
window.onload = function () {
document.getElementById('#div' + arg).scrollIntoView(true);
};
What am I doing wrong?
You need this script in parent aspx page
And you need this anchor -with ID to be used a function parameter from popup- placed next to each product with different ids. So when URL of parent page reload with a hash added to it " page.aspx#x1" it will make the browser scrolls to that element.
And I guess you already have this Linkbutton on parent page, will be target of postback
On colorbox popup you need to pass the anchor Id back to parent
Or it that was a popup window , you would call it like this