Page 1 of 1

Obtaining value from a drop down list problem

Posted: Wed Nov 05, 2008 2:53 pm
by jmestep
I'm not sure exactly where to search for this.
I am creating a file upload control using most of Able's code. I would like to pick up the value from a drop down list box on the form and pre-pend that to the name of the file. I don't know if I have the code in the wrong place or am using the wrong code to try to get the value.
Within the UploadButton_Click event, I have:
string selectedItem = DropDownListTemplateFields.SelectedValue;

then later on is the code to add it to the file name.
If I do something like this, it works:

string selectedItem = "Add this";

What am I doing wrong?

Thanks

Re: Obtaining value from a drop down list problem

Posted: Wed Nov 05, 2008 6:25 pm
by jmestep
Duh, I found it. EnableViewState="true" fixed it. I have it false in most places because of the lectures on how big view state gets then I forget about it until something like this happens.