Can I avoid updating UpdatePanel which kills viewstate?

I selection page, which has a gridview, which presents the user with a list of data elements that they can click “drill” on, - redirect them to the data service page.

Since the list may drag on, we have a series of checkboxes and dropdowns at the top that act as filters.

We just implemented UpdatePanel with UpdatePanelAnimationExtender so that when the page goes back to the database, they would get a good "Processing ...".

The problem is that this seems to violate the presentation in the drop-down lists and checkboxes. Now, when they go to the "details page" and press the "BACK" button to return to the "Select" page, the selected values ​​in the fields and drop-down lists will return to the original default values. The lists are still full, but they “forgot” what they had when the user clicked on the data service page.

I got the .aspx code for UpdatePanel, and the animation was extended and tested, and everything worked perfectly. So, obviously, UpdatePanel and / or AnimationExtender do not play well with the view.

Is there a way to stop the actions of UpdatePanel, in fact, to reset the properties. .Selectedvalue?

+3
source share
1 answer

First I will remove the filtering controls from the UpdatePanel. Assuming that the data for these controls is evaluated in Page_Load, they do not need to be updated every time the filter is applied to the GridView. Only the GridView is updated, so this is probably the only control that should be contained in the UpdatePanel.

Each of the filtering controls can be added as a trigger for updating the UpdatePanel by declaring them in the UpdatePanel control section. Or, if the filtering process is called by the submit button, it will be a control that will be announced in the section. This should save the values ​​of the filter controls in the browser cache.

Nikhil Kothari UpdateHistory control ( Nikhil , ), UpdatePanel .

EDIT: FYI, UpdatePanel "" ViewState. ViewState UpdatePanel, , ViewState . , , , , . .

+2

Source: https://habr.com/ru/post/1711494/


All Articles