Radpanelbar scrolling issue

I have a scroll issue with Telerik control RadPanelBar. The page is on automatic refresh. On the refresh scroll page, RadPanelBar goes up. I handle this with JavaScript. Below image.

enter image description here

Below is the code. His work is great for dealer contacts, but not for staff. I try in the same way (method) to maintain the scroll position for staff.

<script type="text/javascript"> $(".rpSlide ul").scroll(function() { SaveStafftScrollPosition(); }); function SaveStaffScrollPosition(){ yPos = $(".rpSlide ul").scrollTop(); } function ReturnStaffScrollPosition() { $(".rpSlide ul").scrollTop(yPos); } function OnResponseEnd(sender ,eventArgs){ ReturnStaffScrollPosition(); } function OnRequestStart(sender ,eventArgs){ SaveStafftScrollPosition(); } 

In HTML having a piece of code.

 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" ClientEvents-OnRequestStart="OnRequestStart" ClientEvents-OnResponseEnd="OnResponseEnd" OnAjaxRequest="RadAjaxManager1_AjaxRequest"> //some code here </telerik:RadAjaxManager> 

The problem is that he kept the scroll position to zero for staff when I scroll down. Why did he always keep the scroll position to zero for contacts with employees, even I scroll down to the middle / end?

+4
source share
1 answer

Have you tried using the MaintainScrollPositionOnPostback property of the @Page tag and set the AutoEventWireup property to false ?

 <%@ Page Language="VB" AutoEventWireup="false" CodeFile="YourPage.aspx.vb" MaintainScrollPositionOnPostback="true" Inherits="YourPageClass" %> 

MSDN Documentation

AutoEventWireup

Indicates whether page events are auto-updated. true if the event auto-update function is enabled; otherwise false. The default is true. For more information, see ASP.NET Web Server Event Management. Model.

Maintain ScrollPositionOnPostback

Indicates whether to return the user to the same position in the client browser after the postback. true if users should be returned to the same position; otherwise false. default is false.

Note. Developers can define this attribute for all pages by setting the maintainScrollPostitionOnPostback attribute (note that this is case-sensitive in the configuration files) on the Web.config File element.

+1
source

Source: https://habr.com/ru/post/1441480/


All Articles