I am having an issue with my ASP.NET 4.0 page where I want to reset it to the top after a form submission so that the validation summary can be displayed properly.
The setup involves using Ajax and a master page with the following simplified code:
<form id="Form1" runat="server" target="_top" >
<asp:ScriptManager runat="server" ID="SM1" />
<asp:UpdatePanel runat="server" ID="UP1" >
<ContentTemplate>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</ContentTemplate>
</asp:UpdatePanel>
</form>
The content page structure is as follows:
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:ValidationSummary ID="vs1" runat="server" ValidationGroup="ValidateForm" DisplayMode="BulletList"
CssClass="ValidationSummary" ShowSummary="true" ShowMessageBox="false" />
< ... Form Field ... >
< ... Form Field ... >
< ... Form Field ... >
< ... Form Field ... >
...
< ... Form Field ... >
<asp:ImageButton ID="btnSaveChanges" runat="server" ImageUrl="/Assets/Images/btn-AdminSaveChanges.png"
ValidationGroup="ValidateForm" CausesValidation="false" OnClick="btnSaveChanges_Click" />
</asp:Content>
Currently, when a user reaches the bottom of the form and submits it, the page does not scroll back to the top to display the validation summary. I have tried setting maintainscrollposition to false in the content page header but it hasn't helped.
I would appreciate any help or suggestions on how to resolve this issue!