Cloning a DropDownList

G

Guest

Hi All


I have created a survey form in which the questionaire contains 20
questions. Of the 20, 16 are dropdownlist boxes where the user can select
their answer, the Selections are all the same. I am currently running a
function that creates a new dropdownlist by calling a stored proceedure and
adding it to the dropdownlist every time i need one of the 16 boxes. This
seems inefficient to me to be creating them in this manner and being new to
ASP.Net I am wondering if some one with more experience than me can show me
how to clone the the first box after the first dropdownlist is created from
the datareader.

Any Help is greatly appreciated

TIA

TheMightyThor
 
S

S Gopikrishna

Hi There

One way of doing this is by using User Control databound
to the data fetched from stored proc.

-Gopi
 
J

James Radke

Gopi,

I believe all you would want to do is perform the datareader ONCE and hold
it in session (if this is webform - or some other state mechanism). Then,
as you create new listboxes, simply set their datasource to be equal to the
same saved datareader object. This way you are only doing one read,
regardless of the number of listboxes created on the form.

Does that help?

Jim
 

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

Similar Threads

Cloning Possible? 1
Cloning revisited 1
Cloning members of a hierarchy 5
DropDownList Input 9
cloning Iterators? 13
DropDownList not working 0
Cloning Environments 2
dropdownlist missing option text 0

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top