Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > DropDownLists

Reply
Thread Tools

DropDownLists

 
 
Steve Caliendo
Guest
Posts: n/a
 
      06-08-2004
Hi,

I'm having trouble with multiple dynamically generated dropdownlists. On my
web page I have several text boxes / labels / checkboxes and dropdownlists

I have no problem setting the other controls to display what I would like
them to, but the dropdownlist boxes are simply not working. I can't set the
selectedindex to be different for each of the controls. What I'm doing is
this:

Dim TB2 = New TextBox()

Dim TB3 = New TextBox()

Dim DD1 = New DropDownList()

Dim CB1 = New CheckBox()

Dim CB2 = New CheckBox()



This works fine:

TB2.text = Rs1.Item(4)

TB3.text = Rs1.Item(5)

This also works (2 of the dynamic dropdownlists out of 10 get the contents
of dropdownlist2):

If i = 1 Or i = 3 Then

For j = 1 To DropDownList2.Items.Count

DD1.Items.Add(DropDownList2.Items(j - 1))

Next

End If



This doesn't work:

If i = 1 Then DD1.SelectedIndex = 0

If i = 3 Then DD1.SelectedIndex = 1



When the web page is displayed, *BOTH* dropdownlists have the selectedindex
set to 1


Any ideas?

Thanks,

Steve




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
reuse SQLDataReader in multiple dropdownlists? Craig Buchanan ASP .Net 4 01-15-2004 10:23 PM
Positioning in dropdownlists Peter J. Hunter ASP .Net 0 01-14-2004 04:13 AM
DropDownLists in XSLT Colin Basterfield ASP .Net 0 12-17-2003 01:48 AM
Multiple DropDownLists Darren ASP .Net 1 08-18-2003 06:57 AM
parent child dropdownlists acting oddly Craig Buchanan ASP .Net 1 06-27-2003 06:10 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57