Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: set selected field in dropdownlist


Message #1 by "John Tyson" <jtyson@t...> on Tue, 28 May 2002 11:42:17 -0700
Hi,

I'm having some trouble setting the selected value in a dropdown list.

I want the selected item in the dropdownlist to return to the default
when the page is refreshed.  I am trying

lstMyList.SelectedItem.Value =3D 0

This isn't working?

Message #2 by Imar Spaanjaars <Imar@S...> on Tue, 28 May 2002 22:37:07 +0200
Hi there,

Try SelectedIndex = 0 instead.

Right now, you are trying to assign 0 to the value of the selected Item.

HtH

Imar


At 11:42 AM 5/28/2002 -0700, you wrote:
>Hi,
>
>I'm having some trouble setting the selected value in a dropdown list.
>
>I want the selected item in the dropdownlist to return to the default
>when the page is refreshed.  I am trying
>
>lstMyList.SelectedItem.Value = 0
>
>This isn't working?



  Return to Index