DeferredScripts
Represents a container for deferred JavaScript initialization statements for MVC Report Viewer components. Used to collect and render JavaScript initialization code at a specific location in the HTML document for optimal performance and loading behavior.
Definition
Namespace:Telerik.ReportViewer.Mvc
Assembly:Telerik.ReportViewer.Mvc.dll
Syntax:
public class DeferredScripts
Inheritance: objectDeferredScripts
Constructors
Initializes a new instance of the DeferredScripts class with the specified script collection and rendering options.
public DeferredScripts(IDictionary<string, string> scripts, bool renderScriptTags)
The dictionary containing script identifiers and their corresponding JavaScript initialization code for deferred rendering.
renderScriptTagsboolTrue to wrap the JavaScript code in HTML script tags, false to return only the raw JavaScript code.
Enables deferred initialization by collecting scripts during page construction and rendering them at a controlled location in the HTML document.
Methods
Converts the deferred scripts collection into an HTML string containing the JavaScript initialization statements.
public string ToHtmlString()
string
An HTML string containing the JavaScript code, optionally wrapped in script tags depending on the renderScriptTags setting.
Called automatically when the DeferredScripts object is rendered in an MVC view, providing the final JavaScript output for report viewer initialization.