I want to redirect from one page to another page in asp.net MVC 3.0 using javascript/Jquery/Ajax. On button click event I have written javascript code like below.
function foo(id)
{
$.post('/Branch/Details/' + id);
}
My Controller code is like this:
public ViewResult Details(Guid id)
{
Branch branch = db.Branches.Single(b => b.Id == id);
return View(branch);
}
When I click on button it is calling Details action inside BranchController but it doesn't return to Details view.
I didn't get any error or exception. It's showing status 200 OK in firebug. What is wrong in my code and How can I redirect to Details view page. Please help me.