"MscrmGuy" <js********@hotmail.comwrote in message
news:92**********************************@microsof t.com...
Hi all:
I am trying to build a web interface for a CRM demo I am working on, and
one
of the questions on the registration form is "How many children do you
have?" and then I want the user to be able to enter info for each child.
So I'd like the page to function such that if the user enters "4", the
interface updates and displays 4 input rows with textboxes for name, age,
etc. This seems to be hard to do in ASP.NET, does anyone think AJAX might
be
an answer? Can anyone offer any other ideas as to how I might accomplish
this?
You can add controls dynamically with ASP.NET. Using an asp:table you can
add your 4 rows, each containing the number of cells you want. Then you add
the type of controls you want; labels, texboxes, images and so on into each
cell. It is a good idea to use a loop-counter and give each control a unique
ID based on the rowID+controlname. Then you easily can retrieve the entered
values on postback.
One trick that challenged me was that the dynamically controls must be
created each time the page is posted back. The data entered into each
control are automatically stored into viewstate, but you have to design a
loop in the page load section to regrenerate the rows of controls. I'm sorry
I don't have any relevant links for the, but google for "adding controls
dynamically" and you will surely find a lot of info.
Bjorn