All Projects → mjebrahimi → AspNetCore.Unobtrusive.Ajax

mjebrahimi / AspNetCore.Unobtrusive.Ajax

Licence: MIT license
Unobtrusive Ajax Helpers (like MVC5 Ajax.BeignForm and Ajax.ActionLink) for ASP.NET Core

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to AspNetCore.Unobtrusive.Ajax

DNZ.MvcComponents
A set of useful UI-Components (HtmlHelper) for ASP.NET Core MVC based-on Popular JavaScript Plugins (Experimental project).
Stars: ✭ 25 (-45.65%)
Mutual labels:  aspnetcore, aspnet-core, asp-net-core, html-helper, asp-net-core-mvc, htmlhelpers, aspnetcoremvc, aspnet-core-mvc, htmlhelper
OnlineUsers-Counter-AspNetCore
Display online users count in ASP.NET Core in two ways (Cookie - SingalR)
Stars: ✭ 29 (-36.96%)
Mutual labels:  aspnetcore, aspnet-core, asp-net-core, asp-net-core-mvc
Equinoxproject
Full ASP.NET Core 5 application with DDD, CQRS and Event Sourcing concepts
Stars: ✭ 5,120 (+11030.43%)
Mutual labels:  aspnetcore, aspnet-core, asp-net-core, asp-net-core-mvc
Awesome-Nuget-Packages
📦 A collection of awesome and top .NET packages sorted by most popular needs.
Stars: ✭ 87 (+89.13%)
Mutual labels:  aspnetcore, aspnet-core, asp-net-core, asp-net-core-mvc
Znetcs.aspnetcore.authentication.basic
A simple basic authentication middleware.
Stars: ✭ 40 (-13.04%)
Mutual labels:  aspnetcore, aspnet-core, asp-net-core, asp-net-core-mvc
SeoTags
SeoTags create all SEO tags you need such as meta, link, twitter card (twitter:), open graph (og:), and JSON-LD schema (structred data).
Stars: ✭ 113 (+145.65%)
Mutual labels:  aspnetcore, aspnet-core, asp-net-core, asp-net-core-mvc
Aspnetcore Developer Roadmap
Roadmap to becoming an ASP.NET Core developer in 2021
Stars: ✭ 8,248 (+17830.43%)
Mutual labels:  aspnetcore, aspnet-core, asp-net-core
Home
Home for Blazor Extensions
Stars: ✭ 51 (+10.87%)
Mutual labels:  aspnetcore, aspnet-core, asp-net-core
MinimalApi
ASP.NET Core 7.0 - Minimal API Example - Todo API implementation using ASP.NET Core Minimal API, Entity Framework Core, Token authentication, Versioning, Unit Testing, Integration Testing and Open API.
Stars: ✭ 156 (+239.13%)
Mutual labels:  aspnetcore, aspnet-core, asp-net-core
XAF Security E4908
This repository contains examples for Role-based Access Control, Permission Management, and OData / Web / REST API Services for Entity Framework and XPO ORM
Stars: ✭ 47 (+2.17%)
Mutual labels:  aspnetcore, asp-net-core, asp-net-core-mvc
Home
Asp.net core Mvc Controls Toolkit
Stars: ✭ 33 (-28.26%)
Mutual labels:  aspnetcore, asp-net-core, asp-net-core-mvc
Asp.net Core Template
A ready-to-use template for ASP.NET Core with repositories, services, models mapping, DI and StyleCop warnings fixed.
Stars: ✭ 599 (+1202.17%)
Mutual labels:  aspnetcore, aspnet-core, asp-net-core
Znetcs.aspnetcore.logging.entityframeworkcore
This is Entity Framework Core logger and logger provider. A small package to allow store logs in any data store using Entity Framework Core.
Stars: ✭ 24 (-47.83%)
Mutual labels:  aspnetcore, aspnet-core, asp-net-core
AspNetCore-ReCAPTCHAv3
reCAPTCHA v3 Usage in Asp.Net Core MVC
Stars: ✭ 17 (-63.04%)
Mutual labels:  aspnetcore, asp-net-core, aspnetcoremvc
awesome-dotnet-async
A curated list of awesome articles and resources to learning and practicing about async, threading, and channels in .Net platform. 😉
Stars: ✭ 84 (+82.61%)
Mutual labels:  aspnetcore, aspnet-core, asp-net-core
ChatService
ChatService (SignalR).
Stars: ✭ 26 (-43.48%)
Mutual labels:  aspnetcore, aspnet-core, asp-net-core
Practical Aspnetcore
Practical samples of ASP.NET Core 2.1, 2.2, 3.1, 5.0 and 6.0 projects you can use. Readme contains explanations on all projects.
Stars: ✭ 6,199 (+13376.09%)
Mutual labels:  aspnetcore, aspnet-core, asp-net-core
Cronscheduler.aspnetcore
Cron Scheduler for AspNetCore 2.x/3.x or DotNetCore 2.x/3.x Self-hosted
Stars: ✭ 100 (+117.39%)
Mutual labels:  aspnetcore, aspnet-core, asp-net-core
Elmahcore
ELMAH for Net.Standard and Net.Core
Stars: ✭ 127 (+176.09%)
Mutual labels:  aspnetcore, asp-net-core, asp-net-core-mvc
Ext.NET
Ext.NET public Issues.
Stars: ✭ 28 (-39.13%)
Mutual labels:  aspnetcore, asp-net-core, asp-net-core-mvc

NuGet License: MIT Build Status

AspNetCore.Unobtrusive.Ajax

Unobtrusive Ajax Helpers (like MVC5 Ajax.BeignForm and Ajax.ActionLink) for ASP.NET Core.

Features

  • Works with Upload file.
  • Works with [AntiForgeryTokenValidation].
  • Has [AjaxOnly] attribute to limit actions.
  • Has httpRequest.IsAjaxRequest() extension method to check request is ajax and decide return PartialView or JSON result.
  • Additional overloads for ease of use.
  • Adds necessary JS script automatically when you use a Ajax Helpers and remove JS script when you no longer use it (Optional - is by default).
  • Uses CDN url instead of Embedded script (Optional - isn't by default).

Method Usages

Method MVC 5
Html.AjaxBeginForm instead of Ajax.BeginForm
Html.AjaxBeginRouteForm instead of Ajax.BeginRouteForm
Html.AjaxActionLink instead of Ajax.ActionLink
Html.AjaxRouteLink instead of Ajax.RouteLink

Get Started

1. Install package

PM> Install-Package AspNetCore.Unobtrusive.Ajax

2. Add Service and Middleware

public void ConfigureServices(IServiceCollection services)
{
    //...
    services.AddUnobtrusiveAjax(); 
    //services.AddUnobtrusiveAjax(useCdn: true, injectScriptIfNeeded: false);
    //...
}

public void Configure(IApplicationBuilder app)
{
    //...
    app.UseStaticFiles();

    //It is required for serving 'jquery-unobtrusive-ajax.min.js' embedded script file.
    app.UseUnobtrusiveAjax(); //It is suggested to place it after UseStaticFiles()
    //...
}

3. Add Script Tag in Layout.cshtml

    <!--Place it at the end of body and after jquery-->
    @Html.RenderUnobtrusiveAjaxScript()
    <!-- Or you can reference your local script file -->

    @RenderSection("Scripts", required: false)
</body>
</html>

4. Use it

@using (Html.AjaxBeginForm(new AjaxOptions
{
    HttpMethod = "post",
    //Other options ...
}))
{
}

Demo

Checkout AspNetCore.Unobtrusive.Ajax.Demo for more samples.

Demo

Contributing

Create an issue if you find a BUG or have a Suggestion or Question. If you want to develop this project :

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

Give a Star! ⭐️

If you find this repository useful, please give it a star. Thanks!

License

AspNetCore.Unobtrusive.Ajax is Copyright © 2020 Mohammd Javad Ebrahimi under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].