I've created a function for a couple dropdownlist where I retrieve data from a db, format it and then pass the dropdownlist object to the calling app. The data is retrieved and binds find in the function call and seems to pass the list back to the calling
app (it shows the count of the items) but will not display any items. Example
public static DropDownList LoadRxForms(){
DataTable objDT = MedData.GetDT("Medications", "RxForms");
DropDownList ddl = new DropDownList();
ddl.DataTextField = "ItemTitle";
ddl.DataValueField = "Itemvalue";
ddl.DataSource = objDT;
ddl.DataBind();
return ddl;}
this function is called using
ddlRxForms = LoadRxForms();
When I debug and check ddlRxForms.Items.Count I get the correct count of 9, but nothing is displayed in the control. I tried ddlRxForms.DataBind() after the data is returned, but no luck. The only way I can get it ...
Go to the complete details ...