Using AJAX object with ASP.NET WEB API

Index

Attached Files

The following files have been attached to this tutorial:

.zip

c2-and-aspnet-template-project-for-vs-2013.zip

Download now 22.16 MB

Stats

2,833 visits, 8,456 views

Translations

This tutorial hasn't been translated.

Tools

Getting things ready... step 2 of 4

Before we start we must make some adjusts, it will make things easier in the next steps ;)

Tip: You can download a template project at Tutorial Downloads with all code and packages you'll need to start coding ;) If you like to download it, jump to Step 6.

Changing the default project's Route

1. Open the WebAPIConfig.cs file at App_Start folder

2. Search for this line of code:

    routeTemplate: "api/{controller}/{id}",

And replace with:

    routeTemplate: "api/{controller}/{action}/{id}", // New route with Action

This will allow you to call functions by their names on the server from a Construct 2 game.

Click Save in the toolbar or press Ctrl + Shift + S to save all.

Before continue...

Now, try to build the project by clicking BUID > Build Solution. If it fails, go back and revise your code.

  • 0 Comments

  • Order by
Want to leave a comment? Login or Register an account!