15 lines
1.1 KiB
Markdown
15 lines
1.1 KiB
Markdown
[](https://ci.appveyor.com/project/tparnell8/turbolinks-net)
|
|
|
|
Add [turbolink](https://github.com/rails/turbolinks) ASP.NET core 2.1 applications
|
|
|
|
This provides middlewear to add support for turbolinks.
|
|
|
|
Simply install the [nuget package](https://www.nuget.org/packages/TurboLinks.Net/) (`TurboLinks.Net`) add `app.UseTurboLinks();`to Startup.cs and a build of the JavaScript turbolinks file to your layout.cshtml file (one can be found in the wwwroot/js dir of the example project). Consider adding turbolinks after your static files module. You can see an example in `src/TurboLinks.Net.Example`
|
|
|
|
## Why use turbolinks?
|
|
|
|
If you have an application that may not fit into an SPA, or just have a lot of code that is tied to .NET this provides SPA like speed by ajaxing the html and replacing the body with the results. This allows the browser to keep the cache of existing scripts. Turbolinks was made in the rails community, and a lot of existing documentation already exists.
|
|
|
|
|
|
**Warning** This stops page loads thus `$(document).ready(function(){})` does not fire on new pages.
|