Assets

All builded files are placed inside wwwroot/assetsfolder and you can put all your static js, css and media files to wwwrootfolder then these files could be loaded on your views.

Inline svg

Inline svg could be printed using function KTTheme.getSvgIcon(path), this function return a content of your svg file and you can use it to display inline svg in your markup.

@((MarkupString)KTTheme.getSvgIcon("assets/media/icons/duotune/ecommerce/ecm001.svg", "svg-icon svg-icon-3"))

Load javascript files

In Blazor you can load static js files in your views separetly by using JS.InvokeAsyncfunction.

@inject IJSRuntime JS
@inject NavigationManager MyNavigationManager

@code {
    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
        if (firstRender)
        {
            await JS.InvokeAsync<IJSObjectReference>("import", MyNavigationManager.ToAbsoluteUri(“/path/to/your/file.“));
        }
    }
}

Trigger js functions from C#

In Blazor you can trigger javascript function from your C# code, this could be used to trigger js function in different component lifecycle events.

JS.InvokeVoidAsync("KTComponent.init");

Call js function with parameters.

JS.InvokeVoidAsync("KTComponent.init”, “parameters” …);
Learn & Get Inspired

Support at devs.keenthemes.com

Join our developers community to find answer to your question and help others. FAQs
Get Support
HTML Video Tutorials
From guides and how-tos, to live demos and code examples to get started right away.
Metronic Downloads
Download your prefered framework and demo with one click.
What's New ?
Latest features and improvements added with our users feedback in mind.
Buy now