Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing Drop Down List Selected Value 1

Status
Not open for further replies.

rebelknight

Technical User
Jul 4, 2007
35
US
I have a drop down list control inside a user control that is used as search criteria for an ASP.Net page.

The user control sits on my web page and allows a user to select a value from its list of values. When a user selects a value and clicks on a submit button I want to be able display the page with the search results and retain the selected value in the drop down list.

To do this I have placed a Response.Redirect command behind the button to show the same web page again. I want to include a querystring parameter from the selected drop down list value but I can’t figure out how to access the value.

Clearly I need the SelectedValue property of the drop down list but how do I get at it?

I expected I would have to take it from the projectname.searchcontrol.dropdownlist.selectedvalue but that isn’t accepted as valid code.
 
get the selected value from the control and append it to the url then redirect.

when the page loads determine if the query string exists. if so mark that option as selected.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top