DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C# (http://www.daniweb.com/forums/forum61.html)
-   -   Dropdownlist.... please help (http://www.daniweb.com/forums/thread78478.html)

sibotho May 16th, 2007 8:17 am
Dropdownlist.... please help
 
Hi All

I have a dropdownlist in one page, now I want to display the contents of that dropdownlist in a different page, can someone help me with this.

Thanks in advance

pygmalion May 16th, 2007 9:08 pm
Re: Dropdownlist.... please help
 
'page' as in form?

if so, declare the drop-down list yourself and add a public access modifier to it.

in the new form, go through the index of the original list with a for-loop and populate the new one.

hope this helped
pygmalion

sibotho May 17th, 2007 5:04 am
Re: Dropdownlist.... please help
 
Its a website i created, using asp.net 2.0 and c#, Can you please send me the code for this. Just the line of dispalying the items in another web page.

Thanks,

pygmalion May 17th, 2007 8:50 am
Re: Dropdownlist.... please help
 
well, in c#, that would do:

for(int i = 0; i < amountItems; i++)
{
    newDropdown.Items.Add(oldDropdown.Items.IndexOf(i);
}
hope this helped
pygmalion


All times are GMT -4. The time now is 4:36 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC