Monday, July 13, 2015

ASP.NET MVC Call Controller with jQuery $.ajax and Return PartialViewResult


Didn't find a one-stop answer to this question, so here it is:

"How do I POST JSON to an ASP.NET MVC controller?"

It's actually quite simple. Follow the following steps.

1. Create a model to represent the data structure you want to POST

2. Create a controller method to represent the endpoint you want to contact

3. Create the following jQuery call to make an AJAX call from the frontend to the backend

You can return a PartialViewResult from the controller, and as long as the jQuery AJAX call expects html it will be done.

Hope this helps someone.


  1. This comment has been removed by the author.

  2. You explained it so perfectly. I was worried to learn this because I stay busy with affordable essay and I thought it would take a lot of time. But I learned it quickly through your post.

  3. You have a lot of knowledge in resolving this issue. You provide interesting information and explanations of how you did it. The attention you pay to blogging makes it popular.

  4. Gotoassignmenthelp is team of leading professional writers for Assignment Help Writing Services to students all around the world. Contact us today for Best Canada Assignment Help at very affordable price. Under GotoAssignmentHelp we provide many types of help to the students. We are the most reliable assignment helpers. We have gained our specialization after spending most of our times in making ourselves perfect. . We providing 100% plagiarism free Assignment Help. At the point when you pick our Assignment Help Experts assistance, our faculty will consider the quality and your evaluation criteria.

  5. When faced with a problem it is important not to panic, there is always a way out. Writing an academic paper is not the worst thing and if you can not write your own essay writing service canada help you with this. Order an original essay, the author will help to cover your topic and you will have the coolest academic paper.