asp.net - Maintain Scrollbar Postition in TabPanel of Ajax TabContainer after Postback -
how maintain position of scrollbar in tabpanel of ajax tabcontainer after partial postback? far tried following script wont retrieve position.
<script type="text/javascript"> var xpos, ypos; var prm = sys.webforms.pagerequestmanager.getinstance(); prm.add_beginrequest(beginrequesthandler); prm.add_endrequest(endrequesthandler); function beginrequesthandler(sender, args) { xpos = $get('<%=inputtabpanel.clientid%>').scrollleft; ypos = $get('<%=inputtabpanel.clientid%>').scrolltop; } function endrequesthandler(sender, args) { $get('<%=inputtabpanel.clientid%>').scrollleft = xpos; $get('<%=inputtabpanel.clientid%>').scrolltop = ypos; } </script>
you can include maintainscrollpositiononpostback on <%@ page%> directive, this:
<%@ page language="c#" maintainscrollpositiononpostback="true" %>
with this, javascript automatic generated asp.net. but, if control wrapped updatepanel, there no reason complete postback , consequent lose of position.
Comments
Post a Comment