Viewstate or Session or Database Call
<p>I have a this asp.net page which upon first time load:</p>

<p>1: Make a DB call and get data - XML string (this chunk can go beyond 100kb). And this DB call is a bit expensive takes about 5-10 secs.</p>

<p>2: I loop through this XML and create a Custom Collection with values from XML. Then Bind it to a Repeater Control.</p>

<p>Now the repeater control has one text input. User is free to enter values in one or more or all TBs or leave all blank. Then then hit Save button.</p>

<p>On Save Postback, I will have to loop through all rows in the Repeater, Collect all the rows that has some input in the and generate an XML using the initial values and this new input value and Save it to DB.</p>

<p><strong>Problem:</strong>
So I will need reference to all the initial XML values. I can think of these options and looking for inputs on selecting a best one.</p>

<p>1: <strong>ViewState</strong>: Store my Collection or XML string in ViewState - I'm sure it is will be too huge</p>

<p>2: <strong>Session</strong>: Use Session to store Collection of xml string - Again </p>

<p>3: <strong>DB Call</strong>: Make a DB call to get the data again - as I said it is kind of expensive call and my DBA is asking me to avoid this</p>

<p>4: <strong>HiddenField</strong>: Store the essential data from XML in to HiddenField and use that for Save manipulation. i.e. in each repeater item find all the hiddenfields</p>

<p>Which one is best in terms of better request response and less resource utilization on server?
Or is there a better way I am missing?</p>

<p>PS: Have to use ASP.NET 2.0 WebForms only.</p>

<p><strong>Update1:</strong></p>

<p>I tried the following with ViewState:</p>

<p>1: Store entire xml string: ViewState length = 97484 and FireBug shows pagesize - <strong>162Kb</strong></p>

<p>2:Store stripped down version of Collection with required only data: ViewState length = 27372 and FireBug shows pagesize - <strong>94Kb</strong> and with gzip compression it reduces to <strong>13kb</strong>.</p>

<p>With the existing website FireBug shows Size <strong>236Kb</strong>.</p>

<p>So definitely option 2 is better and my new version is better then current website.
So any inputs?</p>
