on one of my page, I let user to filter the content based on the age they choose from the age dropdown list.
here's my code.
$('#age').change(function () {
var ageUrl = "@Request.Url?age=" + $(this).val();
alert(ageUrl);
window.location = ageUrl;
});
here's the problem. I am on the app page.
http:// localhost:60627/apps
first time, I choose an age and get redirected , no problem.
http:// localhost:60627/apps?age=Middle_School
second time, I pick another one.
http:// localhost:60627/apps?age=Middle_School?age=Preschool
in the querystring, age showed up twice. I tried both Request.Url or Request.RawUrl, always includes querystring. what should I use to get only page url without querystring.