DxResourceManager.PreloadScriptPath Property
Ensures that scripts are loaded on time.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.Resources.v25.2.dll
NuGet Package: DevExpress.Blazor.Resources
Declaration
public static string PreloadScriptPath { get; }
Property Value
| Type | Description |
|---|---|
| String | The path to DevExpress scripts (obtained automatically). |
Remarks
The PreloadScriptPath ensures that DevExpress Blazor scripts are loaded before the browser starts rendering markup to avoid flickering.
To avoid flickering on page load, you must modify the <head> section as follows:
For Blazor Server, add the
ResourceManager.PreloadScriptPathproperty to _Layout.cshtml or _Host.cshtml file (depending on the project template used):<head> <!-- ... --> <script src="@DxResourceManager.PreloadScriptPath"></script> <script src="_framework/blazor.server.js"></scirpt> </head>For WASM and Blazor Hybrid projects, add the following line in the index.html file:
<head> <!-- ... --> <script src="_content/DevExpress.Blazor.Resources/js/preload-script.js"></script> </head>For Blazor Web Apps, replace existing resource configuration with the ResourceManager in the App.razor file as follows:
<head> @DxResourceManager.RegisterScripts() @DxResourceManager.RegisterTheme(Themes.Fluent) </head>