There is a crossover with Blazor or rather Jazor is filling a gap between static HTML/Razor pages and Blazor.
When could you possibly use this library and not necessarily Blazor?
- You have got many Partial views in Razor pages and views which you would like to reuse e.g.
public IActionResult OnGetNews() => Partial("_NewsPartial", 10);
- You would like a hybrid of your current website and add simple SPA functionality
- Your project doesn’t require minimising traffic in between the browser and server
This library is using currently:
- TypeScript to handle all common actions workload
- ASP.NET Core 5.0 TagHelpers to simplify using data- and a bit help with strongly typed Controllers and Actions
- GitHub link https://github.com/VaclavElias/Jazor
jazor.jsto your Razor page or _Layout.
@addTagHelper *, Jazorto your _ViewImports.cshtml
- Add more functionality
- Make prompts and spinners pluggable
I will be using Bootstrap in my examples.
Load multiple delayed HTML / Partial Views.
- Load News part
- Load Top News part after 1 second
- This will load your HTML from your desired url
<div jazor-url="/examples/news">Loading...</div> <div jazor-url="@((nameof(ExamplesController), nameof(ExamplesController.TopNews), null))" jazor-delay="1">Loading...</div>
Click a button or link to load HTML / Partial Views to your target element.
<button jazor-click="/examples/itnews" jazor-target="content" type="button" class="btn btn-primary">Show .NET News</div> <button jazor-click="@((nameof(ExamplesController), nameof(ExamplesController.AngularNews), null))" jazor-target="content" type="button" class="btn btn-primary">Show Angular News</button> <div id="content">The content will be loaded here.</div>
TypeScript ASP.NET Core Advance