Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6558733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:14:09+00:00 2026-05-25T13:14:09+00:00

<asp:Content ID=Content1 ContentPlaceHolderID=HeadContent runat=Server> <meta http-equiv=refresh content=4 /> <script type=text/javascript> var xPos1, yPos1; var

  • 0
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
    <meta http-equiv="refresh" content="4" />   
 <script type="text/javascript">

    var xPos1, yPos1;

    var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm.add_pageLoading(pageLoadingHandler);
    prm.add_pageLoaded(pageLoaded);
    function pageLoaded(sender, args) {

        $get('<%=Panel_Users.ClientID %>').scrollLeft = xPos1;
        $get('<%=Panel_Users.ClientID %>').scrollTop = yPos1;
    }
    function pageLoadingHandler(sender, args) {
        xPos1 = $get('<%=Panel_Users.ClientID %>').scrollLeft
        yPos1 = $get('<%=Panel_Users.ClientID %>').scrollTop;
    }
    </script>
</asp:Content>

Doesn’t work, where am I going wrong

    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"  />    

<div style="height: 504px; width: 941px;">
                 <asp:Panel runat="server" ID="Panel_Users" ScrollBars="Auto" Style="z-index: 1; left: 748px;
                     top: 621px; position: absolute; height: 250px; width: 287px">
                     <asp:UpdatePanel UpdateMode="Conditional" ID="UpdatePanel1" runat="server">
                         <ContentTemplate>
                             <asp:GridView ID="Grid_UserTable" runat="server" Style="z-index: 1; left: 2px; top: 5px;
                                 position: absolute; height: 152px; width: 243px" BorderColor="#666666" AutoGenerateColumns="False"
                                 OnRowDataBound="MyGrid_RowDataBound">
                                 <Columns>
                                     <asp:TemplateField HeaderText="Status">
                                         <ItemTemplate>
                                             <asp:Image ID="Status" runat="server" />
                                         </ItemTemplate>
                                     </asp:TemplateField>
                                     <asp:BoundField DataField="TimeReceived" HeaderText="TimeReceived" InsertVisible="False"
                                         ReadOnly="True" SortExpression="TimeReceived" />
                                     <asp:BoundField DataField="TimeRead" HeaderText="TimeRead" SortExpression="TimeRead" />
                                     <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                                 </Columns>
                             </asp:GridView>
                         </ContentTemplate>
                     </asp:UpdatePanel>
                 </asp:Panel>
             </div>

I am trying to make the page stay at the same position when the page refreshes after every 5 seconds and the page goes to top. I tried Page MaintainScrollPositionOnPostback=”true” . It didn’t work, I tried using Ajax but have no idea how to use it. Can someone help me how to do it with Ajax.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:14:10+00:00Added an answer on May 25, 2026 at 1:14 pm

    The MaintainScrollPositionOnPostback only works in IE. To do this you can either roll your own client script or use anchor links on different sections of your page/form.

    Similar questions here:

    MaintainScrollPositionOnPostback is not working – how to debug?

    MaintainScrollPositionOnPostback not working with javascript:__doPostBack

    maintainScrollPositionOnPostback="true" does not work globally after setting in web.config ,but works in page level,what should I do?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this sample below: <asp:Content ID=Content1 ContentPlaceHolderID=head runat=Server> <script type=text/javascript> function test(){ if
I have the following code in the front end <asp:Content ID=Content1 ContentPlaceHolderID=cphMain runat=server> <script
I try to composite scripts using this code : <asp:Content ID=HeaderContent runat=server ContentPlaceHolderID=HeadContent> <script>
<head runat=server> <title><asp:ContentPlaceHolder ID=TitleContent runat=server /></title> <link href=../../Content/css/layout.css rel=stylesheet type=text/css /> <script type=text/javascript src=/Areas/CMS/Content/js/jquery-1.3.2.min.js></script>
I have the following ASP page: <asp:Content ID=Content2 ContentPlaceHolderID=ShellContent runat=server> <form runat=server id=AddNewNoteForm method=post>
I have following view <asp:Content ID=Content2 ContentPlaceHolderID=MainContent runat=server> <h2>Tables <%=ViewData[RetriverName] %></h2> <%using (Html.BeginForm(ResfreshSelectedTables, Home))
<%@ Control Language=C# AutoEventWireup=true CodeFile=WebUserControl.ascx.cs Inherits=WebUserControl %> <script type=text/javascript> function Incrementer() { var txtBox
I cant reach the panelID from the code behind cs file.. <asp:Panel ID=Panel1 runat=server
I'm new to ASP.NET and want to have an asp:content control for the page
I've got a form inside an <asp:Content> block that is being submitted to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.