ClassDeferredScripts
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
DeferredScripts(IDictionary<string, string>, bool)
Initializes a new instance of the DeferredScripts class with the specified script collection and rendering options.
Declaration
public DeferredScripts(IDictionary<string, string> scripts, bool renderScriptTags)
Parameters
scripts
IDictionary<string, string>
The dictionary containing script identifiers and their corresponding JavaScript initialization code for deferred rendering.
renderScriptTags
bool
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
ToHtmlString()
Converts the deferred scripts collection into an HTML string containing the JavaScript initialization statements.
Declaration
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.