I have a list to fill out with directories. I have successfully populated the list using Directories, but my problem is that I cannot get the selected item value. I set a breakpoint on the SelectedIndexChanged event, but my web application did not seem to miss this code.
Here is my code to populate the list:
lstDirectories.DataSource = dtDirectories;
lstDirectories.DataValueField = "DirectoryID";
lstDirectories.DataTextField = "DirectoryName";
lstDirectories.DataBind();
This is how I get the value from the list in the SelectedIndexChanged event:
TextBox1.Text = lstDirectories.SelectedItem.Value.ToString();
Am I doing something wrong here? Thanks for the help!:)
source
share