How do I stop my gridview from caching?
I search for results, click on开发者_如何学JAVAe, it opens in a new window, then edit it, and close the popup.
Then I hit 'search' to refresh my gridview, but the changes do not reflect unless I hit F5. It's caching it and I need to stop it, but I don't know how. IdeaS?
Are you rebinding the grid when the user clicks 'search'? You need to be sure that somewhere in the 'search' method control flow, you're doing this:
dataGrid.DataSource = updatedDataSource;
dataGrid.DataBind();
I'm guessing you're binding your results to the grid during PageLoad. Because the event handler for your search button gets fired after PageLoad, the new search results don't get bound to the grid until the next page request. If this is the problem you'll need to rebind the grid when handling the search button event.
精彩评论