Class 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.
Inheritance
Namespace: Telerik.ReportViewer.Mvc
Assembly: Telerik.ReportViewer.Mvc.dll
Syntax
public class DeferredScripts : IHtmlString, IHideObjectMembers
Remarks
Implements IHtmlString to enable direct rendering in MVC views and provides control over script tag generation for flexible script placement.
Constructors
DeferredScripts(IDictionary<String, String>, Boolean)
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
|
System.Collections.Generic.IDictionary<System.String, System.String>
scripts
The dictionary containing script identifiers and their corresponding JavaScript initialization code for deferred rendering. |
|
System.Boolean
renderScriptTags
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
|
System.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.