Hi,
Does anyone know how to maintain postback while calling WebForm_DoCallback? it always set the vertical scrollbar of the page to the very top.
thanks
Hi,
Does anyone know how to maintain postback while calling WebForm_DoCallback? it always set the vertical scrollbar of the page to the very top.
thanks
on the page you want to maintain position set the following page level directive:
<%@ Page Language="..." MaintainScrollPositionOnPostback="true" ... %>
If you wanted you could set this for the whole site, in which case add the following to your web.config under the system.web block:
<pages maintainScrollPositionOnPostBack="true" />
i had similar problem yesterday after {don't remember what changes}.
the MaintainScrollPositionOnPostback
just stopped working.
use this:
string postbackInvokerUniqueID = Request.Forms["__EVENTTARGET"];
if (!string.IsNullOrEmpty(postbackInvokerUniqueID))
Page.FindControl(postbackInvokerUniqueID).Focus();
that may not give the the exact scroll position, but is close enough