コード例 #1
0
 /// <summary>
 /// Renders the JavaScript required to initialize all components client-side.
 /// This will attach event handlers to the server-rendered HTML.
 /// </summary>
 /// <param name="dnnHelper">DNN helper</param>
 /// <param name="clientOnly">Skip rendering server-side and only output client-side initialization code. Defaults to <c>false</c></param>
 /// <returns>JavaScript for all components</returns>
 public static IHtmlString ReactInitJavaScript(this DnnHelper dnnHelper, bool clientOnly = false)
 {
     return(DnnReact.ReactInitJavaScript(clientOnly));
 }
コード例 #2
0
 /// <summary>
 /// Renders the specified React component, along with its client-side initialization code.
 /// </summary>
 /// <typeparam name="T">Type of the props</typeparam>
 /// <param name="dnnHelper">DNN helper</param>
 /// <param name="componentName">Name of the component</param>
 /// <param name="props">Props to initialize the component with</param>
 /// <param name="htmlTag">HTML tag to wrap the component in. Defaults to &lt;div&gt;</param>
 /// <param name="containerId">ID to use for the container HTML tag. Defaults to an auto-generated ID</param>
 /// <param name="clientOnly">Skip rendering server-side and only output client-side initialization code. Defaults to <c>false</c></param>
 /// <param name="containerClass">HTML class(es) to set on the container tag</param>
 /// <returns>The component's HTML</returns>
 public static IHtmlString ReactWithInit <T> (this DnnHelper dnnHelper, string componentName, T props, string htmlTag = null, string containerId = null, bool clientOnly = false, string containerClass = null)
 {
     return(DnnReact.ReactWithInit(componentName, props, htmlTag, containerId, clientOnly, containerClass));
 }