So, I learned a bit. Someone please tell me if this is correct.
DNN already preserves your scroll position on postback. However it appears to me that this only works in Firefox and Opera. I can't seem to get it to work in IE 6. Is that true? Is there a way to get this to work in IE and I'm just missing it?
FYI, preserving scroll position on postback is already built in to Default.aspx and js/dnncore.js.
Default.aspx has hidden field to store scroll position:
<INPUT ID="ScrollTop" runat="server" NAME="ScrollTop" TYPE="hidden">
Default.aspx registers ONSCROLL event handler as:
if (__dnn_ClientAPIEnabled() && __dnn_m_bPageLoaded)
This function in the onscroll event, if the client API is enabled and the page load has completed, saves the
ScrollTop value in the Form hidden field called ScrollTop. On a Postback this value will be submitted.
if (iTop == null)
iTop = document.forms.ScrollTop.value;
var sID = dnn.getVar('ScrollToControl');
if (sID != null && sID.length > 0)
var oCtl = dnn.dom.getById(sID);
if (oCtl != null)
iTop = dnn.dom.positioning.elementTop(oCtl);
dnn.dom.getByTagName("body").scrollTop = iTop;