0

I've got an ASP.NET Web Form with an HTML row containing: a combo box and a few text boxes. I need to let the user select a value from the combo box then fill in the text boxes. After they do that, I'd like them to be able to click "Add" or something like that to add that data to a grid. They should be able to add an arbitrary number or rows this way. They should be able to delete a row if they wish. Then, when they submit the form, I'd like to be able to grab all the data they entered in the code behind method.

What's the easiest way to do this?

birdus
  • 7,062
  • 17
  • 59
  • 89

2 Answers2

0

You could use either a Repeater or a DataList for this.

Tim
  • 4,051
  • 10
  • 36
  • 60
0

If the input form is small enough then you could use gridview or listview.

Something like this:

You have your let say gridview and in footer row your enable adding seperate items. When user adds a row through footer row then you add each new item to temporary colletion which you store in session. When user ends adding rows you just iterate through collection of items stored in session and add them to database.

Of course this option also allows you to remove items that the user has already added and doesn't want to save them in database.

Regards, Uros

Uroš Goljat
  • 1,806
  • 14
  • 15