locked
List View in Update Panel RRS feed

  • Question

  • User-2142784128 posted

    I have a listview with Datapager to show products. Everything works fine until i wrap the listview in Update Panel.

    When i go to the second (or third etc..) page using pagination and select a product, it goes to another page(used Response.redirect). But when i click the browser back button, instead of showing second (or third etc..) page, it is showing the first page.

    Without update panel it works fine.

    Please let me know if i am unclear with my question.

    Any help would be appreciated.

    Thanks,

    laxy4434

    Tuesday, September 1, 2015 8:28 PM

All replies

  • User1724605321 posted

    Hi laxy ,

    But when i click the browser back button, instead of showing second (or third etc..) page, it is showing the first page.

    Welcome to ASP.NET Forum .

    AJAX pages don’t post back when performing requests tasks so they can’t remember their “previous states”. In .NET 3.5 or later version ,It gives the ScriptManager the ability to manage history for us.  In order to use it, you need to set EnableHistory as true. For details, please check the links below:

    http://geekswithblogs.net/frankw/archive/2008/10/29/enable-back-button-support-in-asp.net-ajax-web-sites.aspx .

    https://rchern.wordpress.com/2008/05/11/updatepanel-backforward-browser-navigation/ .

    https://msdn.microsoft.com/en-us/library/cc488548.aspx  .

    Best Regards,

    Nan Yu

    Wednesday, September 2, 2015 2:17 AM
  • User-2142784128 posted

    Hi Nan Yu,

    Thank you very much for your reply.

    I checked all the links and i understood the concept of adding history points. But I have a small question for you.

    What should i do if ScriptManager is in Master Page and my listview is in a usercontrol (parent page uses that master page). 

    I am unable to write the ScriptManager_Navigate function for the listview in my usercontrol

    Thanks,

    laxy4434

    Wednesday, September 2, 2015 2:46 AM
  • User1724605321 posted

    Hi laxy,

    What should i do if ScriptManager is in Master Page and my listview is in a usercontrol (parent page uses that master page). 

    With user control ,then you'd better create public access function to get the related information ,for example:

            public string Country
            {
                get
                {
                    return this.lblCountry.Text;
                }
                set
                {
                    lblCountry.Text = value;
                }
            }

    Then you could access the related parameters between parent page and usercontrol .

    Best Regards,

    Nan Yu

    Thursday, September 3, 2015 9:25 PM