I have a dropdown that allows users to select a data feed to view. The first time a user selects one, my URL looks like this:
http://localhost/DataFeeds/Viewer/1
On the second selection, it looks like this:
http://localhost/DataFeeds/Viewer/1/2
That's obviously not correct. The 1
should be replaced with the 2
.
Here's the code that causes it:
$('select#ID').change(function () {
window.location.replace("@Url.Action("Viewer", "DataFeeds")/" + $(this).val());
});
I've already tried
window.location.href = "@Url.Action("Viewer", "DataFeeds")/" + $(this).val();
but that does the same thing.
All suggestions appreciated.