locked
MVC and WEB Api in one solution RRS feed

  • Question

  • Hello,

    It's an ASP.Net related question. But I don't see a corresponding forum in here. So posting my question here.

    I have an MVC project and an Web Api project in a solution.

    I want to to get the data to the MVC project through my Web API Services.

    I know, I could use Java script to make Ajax calls to the Web API services to get the data to MVC pages.

    The question is

    1) I want to avoid using Java script for this purpose. I am looking to make calls to Web Api controllers from the MVC        controller to get the data and give it to the views.

    2)  What is the best practice in this scenario and is there any drawback in making calls to Web API controller from MVC controller.

    Any help is highly appreciated.

    Thanks.

    • Moved by Eyal Solnik Monday, September 15, 2014 3:35 PM Irrelevant to C#
    Monday, September 15, 2014 2:57 PM

Answers

  • It's an ASP.Net related question. But I don't see a corresponding forum in here. So posting my question here.

    http://forums.asp.net/

    You have Web API and MVC sections at the above forum.

    • Proposed as answer by Just Karl Monday, September 15, 2014 6:52 PM
    • Marked as answer by Just Karl Monday, September 22, 2014 8:51 PM
    Monday, September 15, 2014 3:24 PM