Use jQuery AJAX in ASP.NET CORE 6? You NEED to see how it´s done!
HTML-код
- Опубликовано: 13 июл 2024
- 🚀 C# Progress Academy - Become a senior C# developer: academy.tutorials.eu/p/csharp...
Learn HOW you can use JQuery AJAX in ASP.NET CORE 6! Want to learn more about C# and ASP.NET?
With JQuery AJAX you can directly send HTTP requests directly from JAVASCRIPT to a BACK END Endpoint in ASP NET CORE 6. Find out how in the video!
Here are some links that you may find interesting👀
· Check out the C# Masterclass: bit.ly/38xC6WW
· FREE C# Download 9 MUST have .NET Developer tools: page.tutorials.eu/tools
We´ll make sure to make a Developer out of you In no time!
☕ You can also support us now by buying us a coffee! ☕ www.buymeacoffee.com/tutorialsEU
And we promise to create more cool content for you!
The jQuery library has a full suite of Ajax capabilities. The functions and methods therein allow us to load data from the server without a browser page refresh.
Ajax gives us the possibility to perform an asynchronous HTTP (Ajax) request.
Timestamps:
00:00 - 00:31 - Intro
00:31 - 02:04 - HttpGet and HttpPost attribute
02:04 - 02:25 - ASP.NET Course
02:25 - 03:42 - Setting up Scripts section
03:42 - 05:37 - Ajax GET
05:37 - 07:00 - Ajax POST
07:00 - 08:01 - Testing the Endpoints
08:01 - 08:19 - Outro
What is AJAX?
AJAX = Asynchronous JavaScript and XML.
In short; AJAX is about loading data in the background and display it on the webpage, without reloading the whole page.
Examples of applications using AJAX: Gmail, Google Maps, RUclips, and Facebook tabs.
You can learn more about AJAX in our AJAX tutorial.
What About jQuery and AJAX?
jQuery provides several methods for AJAX functionality.
With the jQuery AJAX methods, you can request text, HTML, XML, or JSON from a remote server using both HTTP Get and HTTP Post - And you can load the external data directly into the selected HTML elements of your web page!
Without jQuery, AJAX coding can be a bit tricky!
Writing regular AJAX code can be a bit tricky, because different browsers have different syntax for AJAX implementation. This means that you will have to write extra code to test for different browsers. However, the jQuery team has taken care of this for us, so that we can write AJAX functionality with only one single line of code.
Is Jquery and AJAX the same?
AJAX is a web development technique for making asynchronous calls to the server. jQuery is a JavaScript library for designing and make some web development tasks easy. It makes it possible to run javascript outside of the browser. It works on the browser or outside the browser also
What is ASP.NET?
Free. Cross-platform. Open source.
A framework for building web apps and services with .NET and C#.
ASP.NET is an open-source, server-side web-application framework designed for web development to produce dynamic web pages. It was developed by Microsoft to allow programmers to build dynamic web sites, applications and services. The name stands for Active Server Pages Network Enabled Technologies.
It was first released in January 2002 with version 1.0 of the .NET Framework and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime (CLR), allowing programmers to write ASP.NET code using any supported .NET language. The ASP.NET SOAP extension framework allows ASP.NET components to process SOAP messages.
ASP.NET's successor is ASP.NET Core. It is a re-implementation of ASP.NET as a modular web framework, together with other frameworks like Entity Framework. The new framework uses the new open-source .NET Compiler Platform (codename "Roslyn") and is cross platform. ASP.NET MVC, ASP.NET Web API, and ASP.NET Web Pages (a platform using only Razor pages) have merged into a unified MVC 6.
So, how do you use JQuery AJAX with ASP.NET 6? Check out the video to find out!
#aspnet #javascript #jquery #net #code #ajax #net6
TAGS
asp.net core ajax,asp.net ajax,asp.net jquery,jquery ajax,asp.net 6 ajax,asp.net 6,asp.net 6 mvc,asp mvc ajax,asp jquery,asp javascript ajax,assp.net mvc ajax,asp.net mvc jquery,asp.net core mvc ajax,asp.net core mvc jquery,ajax,jquery,mvc,jquery ajax tutorial,asp.net core,asp.net mvc,csharp,jquery ajax asp.net core 6,javascript,javascript tutorial,json,jquery tutorial,ajax tutorial,what is ajax,programming,code,visual studio,dotnet,asp net core
tutorialsEU offers you free video tutorials about programming and development for complete beginners up to experienced programmers.
This includes C#, Unity, Python, Android, Kotlin, Machine Learning, etc.
Stay tuned and subscribe to tutorialsEU: goo.gl/rBFh3x
🚀C# Progress Academy - Become a senior C# developer: academy.tutorials.eu/p/csharp-progress-academy
Execllent! Simple and parctical. Thank you!
Jannick you are the bomb, just like Oz said excellent, simple and practical, love it 🙂
I wish this tutorial was in depth and used a more likely scenario. Can't get an onclick button to find a function in the script tag, and moving the function to the site.js file makes the url for the controller action unreachable.
using ajax to fire off a partial view or view component is about the best thing ive found that isnt blazor server
Let's go!
thank you very much for this great video ❤😍
sure thing!
Good video! Just one thing, a lot of video´s in general on youtube about programming, use hardcoded examples. It would be useful to make a video like this with userinput from a REST service. Its much more useful in the real world. Just a thought from a cs student :)
Thanks. it is very usefull.
You are welcome
How do I handle. Net date time convert to JQuery short date. I have been struggling with that any tips? Internet has been no help at all do I send from an ActionResult View Model?
Doing this when the App is protected with AzureAd resuts in a cors error can you do a video or explain how to manage this?
no link to source?
can u show us how to make a multipart/form-data ajax post?
sure :)
I am getting error: Object 'error' DOMException: Failed to execute 'open' on 'XMLHttpRequest': '/HOME/GETNAMES' is not a valid HTTP method.
how do you have jQuery intellisense working?
where I can get code for this video?
brill
Can anyone explain a bit more on the @await RenderSectionAsync("Scripts", required: false)? So far I just have noticed that without including my scripts in the @section Scripts{}, jquery doesn't work!
Figured it out! Your page is rendering in the _Layout right where the @RenderBody() is placed. This is in the middle of the layout. This means that whatever you have in your page gets inserted here, Including your block. Because it is in the middle, your script block gets inserted BEFORE you declare the use of jquery! The @await RenderSectionAsync("Scripts", required: false) makes it so if you have a section called Scripts, it renderes it AFTER the declaration of Jquery(because you are placing that line of code after the declaration of jquery).
Pretty much, your block gets rendered below the because of @await RenderSectionAsync("Scripts", required: false). If you don't use the @section Scripts{}, it gets rendered above , which makes it so your scripts have no idea of what jquery is.
Can you demo crud using AJAX and don't use Html helper . And Controller like this
Public async taskName(){
----------------------
return ok();
}
Hi, this example demos absolute minimum information and is NOT a useful example at all. It cannot help a beginner to code it. I think it’s only to advertise your courses ?
Hi there, thanks for your comment. We would love to create another video on that topic if you tell us what we could improve.
What is a useful example from your side of view?
Greets
jQuery in 2022/2023 is like using a rusty carving knife to do surgery... why??????
Not true, used it many admin like sites. Sure customer facing, id probably agree in most scenarios. Ive used it in so many prototypes.
I hate jQuery.