HELP... Advanced Form... Need Guru

G

Guest

I have asked this question several times and can't seem to get the answer I
am looking for!

I am trying to create a form that responds dynamically to the users choises
within the page. At the moment I have a dropdownlist that has the values 1-10
in it. What I want to happen is that when the user selects one of the
values... lets say 3! Three parts of the form are repeated! This means that
the three parts of the forms input id's have to be unique!

Simple Code Example:

<asp:dropdownlist id="NoAccounts" runat="server"></asp:dropdownlist>

'Repeat code
<asp:textbox id="fldMobPhoneNo" runat="server"</asp:textbox><br>
<asp:textbox id="fldHomePhoneNo" runat="server"</asp:textbox><br>
<asp:dropdownlist id="ServicePro" runat="server"></asp:dropdownlist>
'End Repeat code

I thought I would put the repeat code in a user control and pull in the user
control as many times as required according to the selection from the
dropdownlist. However I'm not 100% sure how to change all the id's of the
textboxes especially considering the form I'm using is much more advanced
than that show above!

I would really, really appritiate any advice from one of you guru's out
there!

Thanks!
 
S

Steve C. Orr [MVP, MCSD]

Going with a user control is a good approach (although there are other
potentially good approaches too.)
You shouldn't run into naming conflicts because each user control can act as
it's own naming container, meaning ASP.NET will ensure they each have unique
IDs.
 
G

Guest

Thanks Steve!

How about when I come to post the values? Do I need to do anything special
seeing as a part of the forms user id's are contained in usercontrols!

Thanks
 
S

Steve C. Orr [MVP, MCSD]

I don't think so, but I don't understand your project as well as you do...
 
L

Leo Muller

You could of course add the server controls programmatically from the code
behind.

Leo
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top