My dropdownlist box is returing the same value no matter what is selected

No matter what I select my dropdownlist box is posting the value of the first option.

Here is the drop down box

 <asp:DropDownList ID="locationDropDown" runat="server"
           
           
            style="top: 300px; left: 400px; position: absolute; height: 13px; width: 139px"
            DataSourceID="ds" DataTextField="description"
            DataValueField="pkey"
         
        >
           
        </asp:DropDownList>


here is the event that is triggered and passes the value to the next page.
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
         Context.Items.Add("requestor", requestorTextBox.Text)
         Context.Items.Add("supplier", supplierTextBox.Text)
         Context.Items.Add("location", locationDropDown.SelectedValue)
         Context.Items.Add("csRep", csRepDropDown.SelectedValue)
         Server.Transfer("poResults.aspx")
         requestorLabel.Text = locationDropDown.SelectedValue
     End Sub

Here is the catching code on the page load event of the page sumitted to


 Label1.Text = Context.Items("csRep")
soccerman777Asked:
Who is Participating?
 
Salim FayadConnect With a Mentor Commented:
Where is the code that binds the dropdownlist? Is it on the Page_Load event? If so, make sure to put it inside an Not IsPostBack if condition
0
 
silemoneCommented:
Are all of the dropdowns doing this...I noticed you had more than one, or just this one?
0
 
silemoneConnect With a Mentor Commented:
try AutoPostBack = true and see what happens...It will produce a refresh but I want to see if it will change then...
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
soccerman777Author Commented:
Yes both drop downs are doing it. I have already tried setting the auto post back property.  Also if I set an event of a change of the drop down it will not work either.
0
 
rlh68Commented:

What does the source HTML for the drop down in question look like?
0
 
soccerman777Author Commented:
<select name="locationDropDown" onchange="__doPostBack('locationDropDown','')" language="javascript" id="locationDropDown" DataSourceID="ds" style="top: 300px; left: 400px; position: absolute; height: 13px; width: 139px">
      <option selected="selected" value="100001">Oklahoma City CSC</option>
      <option value="100002">Tulsa CSC</option>
      <option value="100003">Amarillo CSC</option>
      <option value="100004">Wichita CSC</option>
      <option value="100005">Dallas/Ft. Worth CSC</option>
      <option value="100006">Houston CSC</option>
      <option value="100007">San Antonio CSC</option>
      <option value="100008">Abilene CSC</option>
      <option value="100009">Beaumont CSC</option>
      <option value="100010">El Paso CSC</option>
      <option value="100011">Odessa  CSC</option>
      <option value="100012">Albuquerque CSC</option>
      <option value="100013">Phoenix CSC</option>
      <option value="100014">Shreveport CSC</option>

</select>
0
All Courses

From novice to tech pro — start learning today.