mardi 28 juillet 2015

Submit multiple dynamic checkbox values in webforms

I am searching for a way to solve this situation:

  • I have a webforms page (.aspx) that has a table on it
  • The rows of the table are generated in the codebehind file (.vb/.cs)
  • each of these dynamic rows has a checkbox, that is added to cell 0 of each row
  • the page has a submit button, that submits the page (postback to same .aspx file)

The idea of the form is like this:

"Please select which of these rows you want to import, by checking those checkboxes"

The problem is that when I press the submit button, the values are lost, probably because the checkboxes (and table rows do not exist when the page loads). Can you suggest how to solve this scenario, so that my checkboxes can be read in the btnImport_Click event after being submitted?




Aucun commentaire:

Enregistrer un commentaire