Using AJAX object with ASP.NET WEB API

2

Index

Stats

12,183 visits, 29,073 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 8 Dec, 2014. Last updated 12 Oct, 2020

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 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.

  • 2 Comments

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