Yeah but how do I find out the index? When I loop through I am checking the value property of the dropdown against the session value. When a match is found how do I get the index?
-----Original Message----- From: dotnet discussion [mailto:[EMAIL PROTECTED]] On Behalf Of Chris Anderson Sent: 29 May 2002 09:35 To: [EMAIL PROTECTED] Subject: Re: [DOTNET] DropDownList > Now I can loop all values in the dropdown no problem, but when I find > a match in the value of the > dropdown=Session("CompanyID") and set the "Selected" proerpty to true, > I get informed that 2 items cannot have the selected value set, which > is fair enough. > > So how do I go about finding out the index value of that companyid? Do > you see what I mean, sorry I haven't explained myself too well here. Instead of setting the Selected property of the listitem, set the SelectedIndex of the dropdownlist Merak You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com. You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.