P
P
password222021-08-11 18:46:29
AJAX
password22, 2021-08-11 18:46:29

How to enable ajax in asp.net mvc (.net 5.0)?

Good afternoon. I am learning asp.net to build websites. I want to learn AJAX. But here's the problem. I've looked at every youtube video I can think of (less than 5 years old) but none of them helped me use ajax! I'm just desperate.

  1. When I install Microsoft.jQuery.Unobtrusive.Ajax from Nuget, I don't get the unobstractive-ajax file.
  2. In all methods I tried "The name 'Ajax' does not exist in the current context"
  3. Even if everything is done through JQuery, errors still appear, and ignorance of js does not allow me to figure out their cause. So it doesn't work here either.


I tried everything I found in the articles. I know c# well, asp.net is good, but I don't know js at all. Why is it more difficult to understand someone else's code.

I would be glad for any help, thanks
Maybe the latest mvc does not support ajax at all? In some article I read this
I am creating a project (Asp net core web Application (MVC))

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya, 2021-08-11
@password22

AJAX seems to work on the client side. Previously, they tried everything to write less js in Razor, but now they have abandoned this.
Just make a fetch call in js
Here is an example
https://docs.microsoft.com/en-us/aspnet/core/tutor...

D
Developer, 2021-08-11
@samodum

The problem is that you are watching videos, and this is the wrong approach to learning.
Ajax does not depend on Asp.net in any way, and even more so on its version.
This is just js code that can be written in any html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question