How to replace Request.IsAjaxRequest() in ASP.NET Core
By FoxLearn 2/18/2024 9:23:59 AM 249
This post shows you how to replace Request.IsAjaxRequest() in ASP.NET Core
You can't find Request.IsAjaxRequest() method in ASP.NET Core.
To check your ajax request in ASP.NET Core you can use Context.Request.Headers.
var ajaxRequest = Context.Request.Headers["X-Requested-With"] == "XMLHttpRequest";
I hope so, you can solve your problem.
- Unable to resolve service for type 'Microsoft.AspNetCore.Identity.RoleManager'
- HTTP Error 500.30 ASP.NET Core app failed to start
- How to Use IExceptionHandler in ASP.NET Core
- How to custom exception handling in ASP.NET Core
- How to create a custom AuthorizeAttribute in ASP.NET Core
- How to manually resolve a type using the ASP.NET Core MVC
- Differences Between AddTransient, AddScoped, and AddSingleton
- How to add security headers to your ASP.NET Core
Categories
Popular Posts
Spica Admin Dashboard Template
11/18/2024