New to Telerik ReportingStart a free 30-day trial

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:

C#
public class DeferredScripts

Inheritance: objectDeferredScripts

Constructors

Initializes a new instance of the DeferredScripts class with the specified script collection and rendering options.

C#
public DeferredScripts(IDictionary<string, string> scripts, bool renderScriptTags)
Parameters:scriptsIDictionary<string, string>

The dictionary containing script identifiers and their corresponding JavaScript initialization code for deferred rendering.

renderScriptTagsbool

True to wrap the JavaScript code in HTML script tags, false to return only the raw JavaScript code.

Remarks:

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.

C#
public string ToHtmlString()
Returns:

string

An HTML string containing the JavaScript code, optionally wrapped in script tags depending on the renderScriptTags setting.

Remarks:

Called automatically when the DeferredScripts object is rendered in an MVC view, providing the final JavaScript output for report viewer initialization.