ttmind

Main Navigation

ttmind
  • jim-jams
  • Tech
  • Positive
Login

Login

Facebook Google

OR

Remember me Forgot password?

Don't have account? Signup here.

Sort by Categorys

.Net

PHP

Java

JavaScript

Database

Server

Client Side

Tools

Artificial Intelligence

Cloud

Hybrid Development

Event

Smart City

Education

Security

Scrum

Digital Marketing

APP Development

Business

Internet

Simulation

Art

Network

Microservices

Architecture

Technology

Leadership

    Top Articles

  • How Does Social Media Bring People Together?
    TTMind Author
  • How to read appSettings JSON from Class Library in ASP.NET Core
    Anil Shrestha
  • Printing Support In Asp.Net Core
    TTMind Author
  • HOW TO EXTRACT TEXT FROM IMAGE USING JAVASCRIPT (OCR with Tesseract.js)?
    Prakash Pokhrel
  • Images Upload REST API using ASP.NET Core
    Prakash Pokhrel
  • Related Topic

  • How to read appSettings JSON from Class Library in ASP.NET Core
  • Printing Support In Asp.Net Core
  • Images Upload REST API using ASP.NET Core
  • How to use IActionFilter, IAsyncActionFilter in ASP.NET Core MVC?
  • ASP.NET CORE - Blazor CRUD operation using ADO.NET
  • Tech
  • About Us
  • Contact Us
  • TechHelp
  • PositiveHelp
  • Jim-Jams Help
  • Terms & Conditions

© Copyright ttmind.com

Main Content

Call Web API Using jQuery AJAX in ASP.NET Core Web Applications

.Net .Net Core about 8 years ago || 6/1/2018 || 3.8 K View

  • Hide

1. Create Project:

2. Add WebAPI folder and add web api controller and rename to MyAPIController:

3. Write Methods in MyAPIController to be called from Jquery: Add model class ‘APIModel’ to declare variables with correct data type to store value. The methods should be given method type (HttpPost, HttpGet etc.) and route path in order to hit the method.

4. Create View page in Home View: Add view elements. Let’s just create a textbox to input the value and a button ‘Submit Value’. 

5. Add jquery.js, javascript file APIView.js and write jquery and ajax functions in javascript file ‘APIView.js’ to call the web api. Add json2.js file to pass json formatted values

6. Link jquery.js at the top view page. Link the javascript file,json.js file to view page below the jquery link.

7. Run the project and see if web api is called and the value is passed:

 

  • 2
  • 0
  • 0
    • Facebook
    • Twitter
    • Google +
    • LinkedIn

About author

Prakash Pokhrel

Prakash Pokhrel

https://np.linkedin.com/in/prakash-pokhrel-42a699a2

Reset Your Password
Enter your email address that you used to register. We'll send you an email with your username and a link to reset your password.

Quick Survey