Cloning a DropDownList

Discussion in 'ASP .Net Web Controls' started by Guest, Nov 10, 2003.

  1. Guest

    Guest 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
     
    Guest, Nov 10, 2003
    #1
    1. Advertising

  2. Re : Cloning a DropDownList

    Hi There

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

    -Gopi
    >-----Original Message-----
    >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 Gopikrishna, Nov 11, 2003
    #2
    1. Advertising

  3. Guest

    James Radke Guest

    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


    "S Gopikrishna" <> wrote in message
    news:069501c3a81f$71d31fa0$...
    > Hi There
    >
    > One way of doing this is by using User Control databound
    > to the data fetched from stored proc.
    >
    > -Gopi
    > >-----Original Message-----
    > >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
    > >
    > >
    > >.
    > >
     
    James Radke, Nov 12, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest

    Cloning Possible?

    Guest, Nov 10, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    402
    Steve C. Orr [MVP, MCSD]
    Nov 11, 2003
  2. =?Utf-8?B?QVZM?=

    cloning

    =?Utf-8?B?QVZM?=, Dec 14, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    497
    Eliyahu Goldin
    Dec 14, 2004
  3. Joel Leong

    Cloning ASPNET account

    Joel Leong, Jun 4, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    358
    Scott Allen
    Jun 4, 2005
  4. Neven Klofutar

    Deep cloning

    Neven Klofutar, Jul 7, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    438
    =?Utf-8?B?bG9uZG9uIGNhbGxpbmc=?=
    Jul 7, 2005
  5. =?Utf-8?B?UCBL?=

    Datasets - Cloning problems

    =?Utf-8?B?UCBL?=, Mar 31, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    376
    sirfunusa
    Mar 31, 2006
Loading...

Share This Page