Say for instance that my URL could have an appended query string (i.e. "&sort="). How can I check for that query value and then make a drop-down list show the same selected value?
Example:
URL could be: example.com/Pages/default.aspx?Type=2&sort=price
or sort may not exist if nothing has been selected.
<select name="SortBy" id="SortBy">
<option selected="selected" value="Item Number">Item Number</option>
<option value="Price">Price</option>
<option value="Weight">Weight</option>
<option value="Date">Date</option>
</select>
I need to take that sort value in the URL and set instead:
<select name="SortBy" id="SortBy">
<option value="Item Number">Item Number</option>
<option selected="selected" value="Price">Price</option>
<option value="Weight">Weight</option>
<option value="Date">Date</option>
</select>
Thanks.