Page navigation with update panel

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
6/25/2010 5:57:48 AM
Gravatar
Total Posts 32

Page navigation with update panel

We've developped a custom real estate module.

on the search page our module shows the results in a gridview within an updatepanel

when a user clicks on a property it navigates to a different page with a different user control to show the details. when pressing the back button in the browser the state of the page is gone.

i'veread about this being a standard issue with updatepanels and navigation and also read about adding historynavigation with the scriptmanager

how the scriptmanager in the layout.master has property historynavigation = false when switch to true debugger still thinks it is false

does anyone found an solution for navigation from a updatepanel gridview to another page and back with having the same results?

peter

6/25/2010 6:16:40 AM
Gravatar
Total Posts 18439

Re: Page navigation with update panel

Hi,

It is a complicated problem, you can try and solve it by setting history points as described here:

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

However, myself, I don't like complicated solutions, so I would try to avoid the problem altogether by not using an update panel in that situation where you want to link to details and come back to the previous page from the detail without losing the state.

For example in the blog feature we used to use an updatepanel for paging the list of blog posts but I ran into a problem getting the content rating control to work in the updatepanel, it worked for the first page but as soon as you changed pages it was not wiring up the rating control (Different problem, same solution). So what I did was further encapsultate the post list into another usercontrol which is used both in BlogModule.ascx and in a supporting page ViewList.aspx. The pager links always point to the supporting page and pass in the page number, so even when on the CMS page that has the blog, as soon as the user clicks a pager link they are no longer on the CMS page but on ViewList.aspx though it looks very much the same to the user. So everything needed to maintain the state is present as query string params and there are no back button problems and the rating works on all pages of the list. This approach also reduces the amount of viewstate in the page. So from my ViewList.aspx page I could further link to detail pages and the back button would work correctly. If you try the paging links in the blog on this site and watch the url you will see. Note that there isn't code duplication since the same usercontrol is used in both the BlogModule.ascx and ViewList.aspx. 

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.