dropdown - parse item - postback

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a dropdown control for a mobile form,

<mobile:SelectionList id="NumberList"
OnSelectedIndexChanged="NumberList_Command"
runat="server"></mobile:SelectionList>

The code I'm using in the method is,

void NumberList_Command( Object Source, EventArgs E ){
labelselect.Text= NumberList.SelectedItem.Text;
}

Which give me an error. What is the proper code to find what text is
selected in the SelectionList control, and can I make it fire automatically
when it is changed?

Thanks.
 
Let me give a little more information, the line;

labelselect.Text= NumberList.SelectedItem.Text;

is the one the give the error, "
Compiler Error Message: CS0117: 'System.Web.UI.MobileControls.SelectionList'
does not contain a definition for 'SelectedItem'"

This same line works in VB.net.
 
Back
Top