Reputation: 105
I have this code in my view to hit one ActionResult
ClearFilters = function () {
$.get("/Mandate/Index/1");
window.location.href = '<%=Request.Url.Scheme + "://" + Request.Url.Authority + Request.Url.AbsolutePath%>';
}
My controller Method
Public ActionResult Index(int? id)
{
//some code
}
with this Code I am able to hit Index Action Result but I am not getting int id value 1?
is that something I am doing wrong here?
Thanks
Upvotes: 0
Views: 281
Reputation: 69915
Try this. See if you get the id value, keeping all other code same.
$.get("/Mandate/Index", { id=1 }, success: function(){
window.location.href = '<%=Request.Url.Scheme + "://" + Request.Url.Authority + Request.Url.AbsolutePath%>';
});
Upvotes: 1