Introduction
In this article we will use the Ajax calls and HttpRequests to the domains to create an AJAX request that would be considered cross-domain between these two applications. First we will create a simple action in the Web API controller "Values Controller". And the second process is to create a view that will perform an AJAX call to this project and retrieve the message from the controller.
Now let's create an application:
- Create a Web API application:
- Start Visual Studio 2013.
- From the Start window select "New Project" .
- Select "Installed" -> "Template" -> "Visual Studio 2012" and then select "ASP.NET MVC4 Web Application".
- Click on the "OK" button.
- From the MVC4 project window select "Web API".


- No we add a action in the "ValuesController". This file exists in the Controller Folder that exists in the Solution Explorer. Select this class and write this code of line.

- public class ValuesController : ApiController
- {
- // GET api/values
- public string Get()
- {
- return "Can you Read This Example?";
- }
- }





Comments
Join the conversation! Your thoughts help the community grow.