By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,258 Members | 1,251 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,258 IT Pros & Developers. It's quick & easy.

HELP... Advanced Form... Need Guru

P: n/a
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!
Nov 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Tim::.." <myatix_at_hotmail.com> wrote in message
news:13**********************************@microsof t.com...
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!

Nov 19 '05 #2

P: n/a
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

"Steve C. Orr [MVP, MCSD]" wrote:
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.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Tim::.." <myatix_at_hotmail.com> wrote in message
news:13**********************************@microsof t.com...
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!


Nov 19 '05 #3

P: n/a
I don't think so, but I don't understand your project as well as you do...

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Tim::.." <myatix_at_hotmail.com> wrote in message
news:DE**********************************@microsof t.com...
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

"Steve C. Orr [MVP, MCSD]" wrote:
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.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Tim::.." <myatix_at_hotmail.com> wrote in message
news:13**********************************@microsof t.com...
>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!
>
>


Nov 19 '05 #4

P: n/a
You could of course add the server controls programmatically from the code
behind.

Leo
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I don't think so, but I don't understand your project as well as you do...

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Tim::.." <myatix_at_hotmail.com> wrote in message
news:DE**********************************@microsof t.com...
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

"Steve C. Orr [MVP, MCSD]" wrote:
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.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Tim::.." <myatix_at_hotmail.com> wrote in message
news:13**********************************@microsof t.com...
>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!
>
>


Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.