2

I am working on a page which has 3 jQGrids and i use JSON to bind it. Working on MVC 3 application.

Example, i have a dropdown that shows Department Name list, if i change any department i need to load all the employees under that department in my grid. User edit some records in a grid often.

But the user will never save immediately, they keep editing so many department employees and do a single save.

To persist all the changes till user click global save, i decided to keep all the employee record details in a JSOn format stored in a hidden field. So i load from hidden and bind to grid based on selected department and update local JSON when user update in grid and finally i send the hidden JSON to server.

I am storing 10 fields of 100 employee details JSON data in hidden field and use. I know i am increasing response size and post data size. Question is, will it impact a big problem in performace? or can i store in a session and load from it? Which would be the best way?

Billa
  • 5,226
  • 23
  • 61
  • 105
  • I prefer storing it into session and access same. Make sure you remove those once you have done global Save. Not sure even storing 100 employee objects in Session will impact IIS process time :( – Murali Murugesan Jan 31 '13 at 06:46

1 Answers1

2

Theoretically there is no other problem than the delay that a page make to send back the data when the user make post back.

But in real life I have see (rare but existing ones) problems with very big fields on post back. Some routers, or proxy they cuts them, or block them - I do not know the actually reason, some times they maybe just stupid filters.

To avoid this rare case from happening you can compress and split the input hidden field to more than ones (the issues appears when the size is huge on one).

Now, the session is a good solution that can help to minimize the data send front and back. Its may grow up the session, and you must find a way what and how you handle if the user opens two same windows, the session data must be two different ones.

Some examples on how you can compress the input field. Is talking about viewstate, but the idea is the same:

http://www.codeproject.com/Articles/14733/ViewState-Compression

http://www.hanselman.com/blog/ZippingCompressingViewStateInASPNET.aspx

http://www.bloggingdeveloper.com/post/How-To-Compress-ViewState-in-ASPNET-20-ViewState-Compression-with-SystemIOCompression.aspx

Community
  • 1
  • 1
Aristos
  • 66,005
  • 16
  • 114
  • 150
  • Thanks a lot. I started using Session. My goodness my client don't want to open two different window. He asked me to keep using single window. Initially i opened this page using window.opener and now response.redirect. However even if the open same page, he will be referring only one session object which is shared by two pages, he always can see both pages changes when it loads via ajax, when he change department. Your answer is really helpful. Thank you so much – Billa Jan 31 '13 at 07:06