SelectedValue from a Dropdown is always defaulting to first item in list, regardless of what I select
Posted on 2004-10-25
I have 3 dropdown lists on my asp.net page and a button called "Output Report". I either need to post the selections to another aspx page (ideal) or grab the 3 selected values and pass them in a querystring.
I am having difficulty with scenario 1 (post to another page). Whenever I change the name of the form action from Page1.aspx to Page2.aspx, save and rebuild, when I view the HTML source of Page1, it shows the Form Action going to Page1.aspx.
So what I have been attempting to get around this is put a command on my "Output Report" so that I grab the selections using Select1.SelectedValue, etc. and pass them to Page2 in a querystring, like Response.redirect "Page2.aspx?Select1=" & Select1.SelectedValue......etc.
What is happening is that it ALWAYS grabs the first value of my dropdown lists, regardless of what I select.