Question

In VS 2010 the ASP.Net Web Application template creates a master page with two content pages: Home and About. State is lost as you navigate to a new tab. As a windows developer I'm struggling with how to return pages to the state the user left them in.

My Customers tab allows the user to filter customers and select one from an AspxGridView. The selected Customer id will be used on other pages (tabs) to display related customer data: Contacts, Invoices, Tasks etc. I'd like to allow the user to return to the Customer tab as he/she left it with the filter, sorting etc. still in tact.

I'm aware of cookies, query strings, view state & session variables. However, as the user navigates away I don't know how to capture the user's filter and sort information from the DevExpress AspxGridView that I would need to re-build the grid state.

Should I re-design the app to be one massive page containing every tab? That would help with maintaining view state, but it could get out of control. My company would like this app to become a full-fledged CRM and I don't want to create a maintenance nightmare.

I'm looking for advice on how to best maintain state across tabs/pages in an ASP.Net web forms application that could grow quite large over time.

Was it helpful?

Solution

However, as the user navigates away I don't know how to capture the user's filter and sort information from the DevExpress AspxGridView that I would need to re-build the grid state.

It is possible to use the ASPxGridView client layout data. The DX ASP.NET grid control offers the special infrastructure for this purpose:

ASPxGridView > Main Features > Save and Restore Layout:

http://help.devexpress.com/#AspNet/CustomDocument4342

E2534 - How to save/load the ASPxGridView's ClientLayout Data and choose them from the ASPxListBox:

http://www.devexpress.com/Support/Center/e/E2534.aspx

OTHER TIPS

Unlike WinForms, the web is stateless. ASP.NET gives you a few options for maintaining state between pages and post backs. A great place to start is MSDN.

ASP.NET State Management Overview

How to: Pass Values Between ASP.NET Web Pages

I'm not familiar with AspxGridView, but most server controls use ViewState to maintain state between postbacks. You could start by confirming that ViewState is enabled on the control, page and web.config.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top