473,405 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

DropDownList selections no longer work

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?

Nov 18 '05 #1
1 866
Are you sure it is finding the value?

"branton ellerbee" <bl**@sbcglobal.net> wrote in message
news:ID*****************@newssvr11.news.prodigy.co m...
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?


Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: theo | last post by:
Program flow...load file,then extract the xml text tags from the file,then the number of Xml tags retrieved from the file determines the number of dropdownlist controls instanciated in the...
4
by: Kathy Burke | last post by:
Having a brainfade and can't even remember what this is called...so searching hasn't worked very well! I have a dropdownlist and when I hit the S key, for example, I want the selection highlight...
3
by: André Almeida Maldonado | last post by:
Hy Guys, I'm receiving this error and I don't know why... A DropDownList cannot have multiple items selected. What can I do?????????? Thank's
5
by: DC Gringo | last post by:
I have a dropdownlist that, upon form submission, I'd like to maintain the selected value when I get my result...how do I do that? <asp:dropdownlist Font-Size="8" id="ddlCommunities"...
1
by: Vi | last post by:
Hi, I have a pop-up window in which I have 3 WebControls.DropDownList controls. I make my selections and when I submit the page, in the code behind page one control has the right value for...
2
by: Steffen Loringer | last post by:
Hi all, may be an easy question: How can I allow multiple selections in a dropdownlist? Thanks Steffen
1
by: mark4asp | last post by:
I moved a page to another web-site and now it's broke! I had 5 pages in their own web-site. These pages have now been moved to another web-site. Everything is fine except that one of the pages,...
1
OuTCasT
by: OuTCasT | last post by:
i have 4 dropdownlist boxes on my form. it controls a datagridview on the page. The datagridview is populated with certain values from the selections of the dropdownlist boxes. i got the select...
0
by: =?Utf-8?B?SmFtZXMgUGFnZQ==?= | last post by:
Hi all A simple problem: I have an aspx page with a details view on it. The page is designed to collect the users selections and add those selections to a SQL database. In the details view...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.