I have ajax request,
onLanguageSelection: function () {
$("#submitLocalizationVm")
.click(function (event) {
var localizationId = $("#surveySectionsLocalizationList option:selected").val();
var surveySectionId = $("#SurveySectionId").val();
if (localizationId) {
LinkAjax.ajaxRequest($localizationEditVmUrl += surveySectionId + "&localizationId=" + localizationId,
"random data",
"localizationPartial",
null,
null,
localizationSelectList.populateLocalizationViewModel);
}
});
},
I have an mvc controller with the following method.
public string GetEditLocalizationInformation(Guid surveySectionID, Guid localizationId)
{
//...
return new JavaScriptSerializer().Serialize(model);
}
I am getting an error. The first time I make a request with the parmaeters surveySectinID = 2 and localizationId = 3 it is successful. If I make another request without refreshing the page with the parmeters surveySectinID = 2 and localizationId = 4 then localizationId will concatenate both values from the request and become 34. What is going on here? The ajax request is sending the correct values through.
Request.QueryStringthere?+=to concatenate the string so on the second request it messed up!! Thanks for that.