Oct 11, 2017, 5:49 PM
Maintain Scroll Position after asp.net Control Postback Event
Hi,
In my page I use asp.net Control with post back event inside ext.Panel.
The problem is the page is quite long, and the asp.net control is need to be at the bottom page. And every time the post back event is triggered, the page will always scrolls back to the top. In normal asp.net page I can add MaintainScrollPositionOnPostback="true" to keep the scroll position, but it doesn't work when I use ext.net Control. Does anyone have any suggestions for this problem?
(In this sample I use Button Control):
In my page I use asp.net Control with post back event inside ext.Panel.
The problem is the page is quite long, and the asp.net control is need to be at the bottom page. And every time the post back event is triggered, the page will always scrolls back to the top. In normal asp.net page I can add MaintainScrollPositionOnPostback="true" to keep the scroll position, but it doesn't work when I use ext.net Control. Does anyone have any suggestions for this problem?
(In this sample I use Button Control):
<%--<%@ Page Language="C#" AutoEventWireup="false" CodeFile="Test2.aspx.cs" Inherits="Test" %>--%>
<%@ Page Language="C#" MaintainScrollPositionOnPostback="true" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.Net Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:DisplayField runat="server" ID="LblPeriode" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="LblEntitas" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="LblJenisRisiko" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField1" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField2" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField3" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField4" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField5" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField6" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField7" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField8" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField9" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField10" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField11" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField12" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField13" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField14" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField15" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField16" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField17" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField18" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField19" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField20" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField21" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField22" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField23" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField24" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField25" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField26" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField27" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField28" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField29" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField30" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField31" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField49" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField50" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField51" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField52" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField53" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField54" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:Panel
runat="server"
Title="Inherent Risk"
Collapsible="true"
Margin="0"
AnchorHorizontal="550px">
<Content>
<asp:Button ID="Button1" runat="server" Text="Button" />
</Content>
<Plugins>
</Plugins>
</ext:Panel>
<ext:DisplayField runat="server" ID="DisplayField55" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
<ext:DisplayField runat="server" ID="DisplayField56" FieldLabel="Label" LabelStyle="font-weight:bold" FieldStyle="font-weight:bold"></ext:DisplayField>
</form>
</body>
</html>