DropDownList selections no longer work

  • Thread starter Thread starter branton ellerbee
  • Start date Start date
B

branton ellerbee

HAs anyone ever had the problem of coded and tested DropDownList just stop
working?

I have.

Here is the code:

Dim OTID as Double = 1


'set the var from the recordset
OTID = DReader("ordertypeID_fk")

'Populate the dropdown and select the item with the ID returned from the DB
ExecSql = "SELECT * FROM vw_GetOrderType"
lstOrderType.DataSource = fetchData(ExecSQL, "otype", DSN)
lstOrderType.DataBind ( )
lstOrderType.items.FindByValue(OTID).selected = true

Code one the page:

<asp:DropDownList id="lstOrderType" runat="server"
DataTextField = "vcOrderType"
DataValueField = "ordertypeID_pk" />

But it doesn't set the value like it should. It just defaults to the first
item in the DropDown.

What is the deal. The code worked when I wrote it and it works else where in
the application. Anyone ever seen this before?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top