Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8351391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:36:55+00:00 2026-06-09T08:36:55+00:00

I am new to ASP.Net MVC and ASP.Net web api. I have worked on

  • 0

I am new to ASP.Net MVC and ASP.Net web api.

I have worked on Web services and cosuming them.

But I am not sure how to host ASP.Net web api and consume the same from another ASP.Net MVC application. I found some samples where people are using the api from the same project. In real world I really doubt the usage would be limited to one project.

Can some body please post some examples or links which can explain the same?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T08:36:56+00:00Added an answer on June 9, 2026 at 8:36 am

    Hosting ASP.NET Web API in an MVC web application makes perfect real world sense if you are mostly using the API to make AJAX type calls from your web client. Having the API and web application in the same project eliminates issues with cross-domain Ajax calls, which requires JSONP. But ASP.NET Web API can easily support JSONP if needed with a custom formatter like JsonMediaTypeFormatter available from WebApiContrib.

    ASP.NET Web API makes developing REST API’s easy. You use the same conventions as developing a controller in MVC. To create it separate from your web application just create an MVC 4 project and create your controllers using an ApiController instead of the standard Controller for rendering Views. Then just deploy your application just like any web application to IIS (you can also self-host ASP.NET Web API’s in something like a Windows Service). Here is an example on the official ASP.NET Web API website that calls a REST API developed in ASP.NET Web API from a console application. There are many more examples on this site.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My new ASP.NET MVC Web Application works on my development workstation, but does not
I'm converting from the WCF Web API to the new ASP.NET MVC 4 Web
I am thinking about creating my new asp.net mvc web application compatible with native
From a brand-new ASP.NET MVC 4 Beta Web Application, I'm re-arranging my folders to
Completely new to asp.net mvc... completely new to web apps so bear with me...
I have a new asp.net mvc project and i am trying to figure out
I have created the following project structure for my new asp.net mvc project any
I'm implementing a web API using the REST for ASP.NET MVC framework (MVC 2).
I created a new ASP .net mvc 2 web application with that default template
If you create a new ASP.NET MVC 2 Web Application and run it, you

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.