Keep gridview data source in post-back

Asked

Viewed 298 times

0

I have a gridview that is filled by a web-service with data coming from SAP. It can return up to 2000 row with 30 columns. This content is always the same, so when running the web-service 10 times will always return the same content. This grid is displayed to the user where filters and sorting can be applied through the column headers. I can save the Datatable (or list) from the grid data source in the viewstate and perform the filters and sorting. Only the Viewstate does blow up. Would you be able to keep/save this content in the post-back, so you can filter and sort? Because it makes no sense to run the webservice again, it takes time and is always the same return.

1 answer

1


To ViewState would really be the first option to try, the second would be to try to work with the Session.

Another recommended option would be for you to do the Cache and use it where necessary.

  • Session also does not give therefore where the system runs,it is already in production, they limit the size of the Sessions. About the Cache, just want to confirm if you would not have another solution, before checking the possibility of using it.

  • You could do a temp table on your db too. 'Other' solution, but somewhat (I allow the use of this word) unviable... would save a physical file and reconsult that file.

  • I also think it would be the simple and correct solution. But to write in the comic I can not, the system is already in production, the company is full of bureaucracy. So adding another table in the comic would be considered improvement. And the process depends on risk assessment, cash forecasting and bidding. A change in the code can be considered maintenance. I even thought about saving Datatable as xml. Only it would have to stay in the cookie folder, because as far as I know, it’s the only place I can record using a web app. I just thought it would be too tricky. kkk

  • Sit and cry then because in your situation my friend, I think it would be ideal for now kkk... pranks the part the maintenance I will have to do one way or another. I thought of something that would be completely strange to do... however,.

  • kkkk... Every solution gets stranger than the original. It really is a troubled situation and full of intricacies. I think I’ll start with the cache and then test the other solutions discussed here. I think it’s worse that this one can’t get, can it? kkk... If it is not possible to solve it will look like this. I appreciate the tips. Thanks!

  • never say that worse than what is not gets... remember that Murphy is on the loose. But go there, test is always the best means to solve a problem.

  • I’ll try it anyway! I just wanted to see if I wasn’t leaving to evaluate some other option. Thank you! And really it’s crying.

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.