Tables and ViewState

  • Thread starter Thread starter chris
  • Start date Start date
C

chris

I have an ASP.NET web page which contains a dynamically generated table.
The user checks a checkbox in one or more rows and then clicks an OK button
which then passes the selected row numbers to a second web page. However
when OK is clicked and I get the postback then I loose the checked items and
so the OK button code cannot pass them on.

Is there any way to save the list of selected row numbers just before the
postback, possibly to ViewState? (My understanding is that dynamic tables
don't support ViewState.) I can't find any page event that I can hook into
to save the selected rows to ViewState. Currently I'm using JavaScript to
maintain the list in a hidden field (with ViewState=True) and this works
fine but it seems a bit messy.
 
Back
Top