emblewembl
Programmer
Hi, I am building a form which will load each element dynamically into placeholders. However I am having trouble finding out how to collect the values once the form has been posted. I am building a dropdownlist from some data and binding it to my placeholder as follows:
In my page_load sub I am using 'If IsPostBack Then...' and then trying to collect the value that was selected as follows:
... where CustFound is the name of a label on my page. However I am just getting an error message to say that 'FindCust has not been declared', even though in my sub where I build the text box it is declared as follows:
If I remove the line where I try to collect the values the page loads fine. This is driving me mad!!!!!! Please help......
i love chocolate
Code:
FindCust.DataSource = OurDataReader
FindCust.DataTextField = "Customer_Name"
FindCust.DataValueField = "Sales_Ledger_Code"
FindCust.Autopostback = true
FindCust.Databind()
CustPlaceHolder.Controls.Add(FindCust)
Code:
CustFound.Text = "Text : " & FindCust.SelectedItem.Text & "<br>"
Code:
Dim FindCust As new DropDownList()
i love chocolate