
November 10th, 2004, 11:44 AM
|
|
Registered User
|
|
Join Date: Nov 2004
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
ASP.Net DropDownList Problem
I am having an issue with an ASP.Net page that I cannot solve.
Essentially, the DropDownLists do not always show the right value. 1st things first, I know it is not an IsPostBack issue.
That was the first thing that I was pointed to as being the source of my problem, but I am positive that it is not the relevant
issue.
I have an ASP.Net page which has approx. 30 drop down lists that are populated when the page is loaded. There are several different ways that they are populated, but it does not appear any one way is wrong. An example is:
Code:
Dim SDR1 As SqlDataReader
With DDL1
SDR1 = SqlHelper.ExecuteReader(sqlConn, CommandType.StoredProcedure, "Doc_SensoryLevelList")
.DataSource = oDRSensoryLevel
.DataBind()
SDR1 .Close()
oLI = New ListItem
oLI.Text = "NA"
oLI.Value = "null"
.Items.Insert(0, oLI)
EndWith
That little snippet fills the drop down list from a stored procedure from my SQL Server. The code works fine, the DDL is filled correctly. But when I go to retrieve the value to send it back to my database, the DDL always has the same value, seemingly the last value.
Code:
prmInsertRound(11).Value = IIf(DDL.SelectedItem.Value = 0, DBNull.Value, DDL.SelectedItem.Value)
The bizzarre thing is that of the 30 Drop Down Lists on my page, only 12 of them have this problem. The others all function correctly, and have no issues. There are no signifigant differences in the way the DDL's are filled, and in the way the data is retrieved.
Once again, I am positive that this is not an IsPostBack issue. Anyone else ever experienced this issue?
Your help is greatly appreciated.
|