I have a web control that is a long form that users fill out. There are many checks along the way, lots of scrolling and lots of postbacks.
For every button click or postback action (radio select, dropdown changes) I use this in my code behind:
Page.MaintainScrollPositionOnPostBack = True
Which works as expected. It scrolls back to that button or event that called it. However, on the web control, there is an Update panel:
<asp:PlaceHolder runat="server" ID="plFingerprint" Visible="false">
<tr>
<td colspan="2" class="l">
<asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<uc1:Listener id="tidListener" runat="server" />
<a href="FingerBio:match,--=7392=--,<%= tidListener.SessionID.ToString() %>,<%= ReplyIndex.BaseSiteUrl %>">
<img id="Img1" runat="server" src="~/images/finger.png" class="scan"
alt="Scan Finger" /></a>
<asp:Label ID="matchlabel" runat="server"></asp:Label>
<div style="display: none">
<asp:Label ID="matchIDLabel" runat="server"></asp:Label></div>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</asp:PlaceHolder>
This is essentially a fingerprint scanner that refreshes every 15 seconds to get any new fingerprints captured. What basically happens is that the user will be capturing data well down the form, when the interval kicks in, the panel is updated and the screen is positioned back to the top (which is where the update panel sits BTW). It reads data from a web service linked to the site.
Now this is frustrating to say the least. Users complain that the screen jumps all the time.
I have the
Page.MaintainScrollPositionOnPostBack = True
everywhere it needs to be, but that doesn't stop the update panel from taking over.
I would like to use anchors, but that will not work with our website structure.
Is there anything else I can attempt? I would like the update panel to continue to update as normal, every 15 seconds, without repositioning the screen each time.
Could this be done in Javascript? Code behind? Something as simple as a change on the form itself?
EDIT
This is on that control itself:
<asp:Timer ID="timerTid" runat="server" Interval="1500" OnTick="timerTid_Tick">
Could I set the interval in code, after the user has or has not used this facility?
Managed to solve my issue by adding this to my ScriptManager
LoadScriptsBeforeUI="true"
That makes all scripts load up, so the control gets it data and refreshes, but without all the scrolling.