asp.net - Is converting a DataTable stored in Viewstate to a List<T> a bad option? -


i've started new job , inherited nightmare webforms .net 4.0 project that's going wrong in lots of places.

i've got user control storing datatable in viewstate. code referencing columns throughout code index number making totally unreadable. know can reference columns name make more readable i'd prefer break out list.

the previous developer storing list in viewstate because changes can't persisted database, read in data, sales people can make modifications pricing , information pushed xml format generate sales order form in pdf. need mechanism storing temporarily.

if had luxury of starting scratch i'd pull data down in json , client side don't have luxury yet.

  1. it's been long, long time since worked datatables , i'm pretty sure it's not placing in viewstate, correct? kind of load placing on viewstate; we're looking @ 44 columns , around 25 rows. :s

  2. secondly, if there big difference between placing list in viewstate opposed datatable or both bad each other - in case i'm doing no harm current position switch out?

  3. third question, updates rows automatically updated in viewstate datatable, same list?

  4. last one, more probing advice. best place store information (preferably list) server side - session or cache better?

  1. you correct. it's terrible idea store datatable in viewstate.

  2. storing list in viewstate still bad , perhaps marginally better storing datatable.

  3. it's not clear mean "updates occur automatically on datatable." unless retrieve datatable viewstate , apply updates programmatically, doubt case. you'd have same if use list.

  4. session better may run scalability issues. frankly, store in session opt using 1 of out of proc state providers. way serialized datatable not sent client on every request making page size horrendously big while giving option store serialized data on different places, sql server or asp.net state server, example.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -