public JsonResult UnassToOrder(string location, string article_number)
{
//....
return Json(new {
success = true,
redirect = "ImportXML/Index"
});
}
<script type="text/javascript">
$(document).ready(function() {
$('input:radio').click(function() {
var location = $("input:checked").val();
var article_number = $("input[id=MArticleNumber]").val();
$.post("/SomeController/SomeAction", { location: location, article_number: article_number }, function(data) {
window.location.href = data.redirect;
},"json");
});
});
</script>
I have 3 radio buttons. When click on first one I have redirect to "ImportXML/Index" with this line of code: window.location.href = data.redirect;
. When I click on second radio button my URL on browser is "ImportXML/ImportXML/Index" and this is error because correct URL is "ImportXML/Index"