Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Solution to temporarily maintaining & displaying data

Status
Not open for further replies.

meckeard

Programmer
Aug 17, 2001
619
0
0
US
Hi All,

I have a web page that has a table/1 row/2 cells. Each cell has an asp:TextBox (for sake of argument, let's call this the primary row). The user supplies the 2 values then submits the form.

When the form submits, I need to grab the 2 values and store them along with any previous values entered in the these 2 textboxes.

Now, after the page posts, I need to show any stored values *before* the primary row. it will be used as a confirm prior to actually entering all the records.

I tried to dynamically add rows and cells, but this didn't seem like an efficient way to do it. Additionally, it was a lot of code to loop thru viewstate (which is where I was storing the values) and add each row, cell and value.

Ideally, I would love to grab the values, store them and then bind a control (repeater maybe?) in the first row of the table to the storage mechanism. This way, if there were no stored records, the control would not appear, just the primary row. Then, after posting, the values would bind to the control in the first row and appear above the primary row.

Does anyone have a solution?

Thanks,
Mark
 
It may be easier to use a DataList or DataGrid instead of a repeater, but I think your solution is perfect.
 
BoulderBum,

Do you know how to bind viewstate to a datalist or datagrid?

Thanks,
Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top