What's a good way to store the info in a multi-stage form?

A

Alan Silver

Hello,

I am designing a form that allows people to request the formation of a
limited company. When they fill in the form, they have to supply a
certain amount of information relevant to their choice (company name,
address, various other options). I was thinking about doing this with a
wizard control as that allows me to split the form into manageable
chunks.

One of the features is that they can optionally specify a number of
people to be the company's directors. I am trying to work out the best
way of doing this. Basically, for each director, I need to show the same
subform, where they enter the person's details. Trouble is, I can't just
rely on the normal view state to save this info as I can with other
controls on the form, as there could be any number of directors.

Any suggestions about how to store the info? I thought about writing a
Director class, and creating an instance of this for each director
entered. Is this sensible? Is there a better way? How do I store the
objects in view state?

TIA
 
C

Curtis

You could use a data repeater control and create an "Add Director"
button on the form. Then, during postback, you can put add the new
director, with blank text boxes, to the data repeater along with a
"Save" button (code would probably make this easier to follow, right?).


Curtis
 
A

Alan Silver

You could use a data repeater control and create an "Add Director"
button on the form. Then, during postback, you can put add the new
director, with blank text boxes, to the data repeater along with a
"Save" button (code would probably make this easier to follow, right?).

I understand what you mean, but I'm not sure if this is the best way to
do it. When I said there could be any number of directors, I should have
said that in practice there are rarely more than about three or four. A
repeater might be over the top.

Presumably your suggestion still leaves me with the question of how to
store the data. There would be too much to rely on showing it all in the
data repeater.

I was thinking about having an array (array list, collection, whatever)
of the director objects, and just adding to the array whenever a new one
were added. Does that make sense? If so, how do I store the array in
viewstate?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top