# C1.Web.Mvc.Component

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_Web_Mvc_Component" data-uid="C1.Web.Mvc.Component" class="text-break">Component Class
</h1>
  <div class="markdown level0 summary"><p>Defines the C1 MVC component class.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><span class="xref">Component</span></div>
      <div class="level2"><a class="xref" href="C1.Web.Mvc.Control.html">Control</a></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.html.ihtmlcontent">IHtmlContent</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.Web.Mvc.html">C1.Web.Mvc</a></h6>
  <h6><strong>Assembly</strong>: C1.AspNetCore.Mvc.dll</h6>
  <h5 id="C1_Web_Mvc_Component_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public abstract class Component : IHtmlContent</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public MustInherit Class Component
    Implements IHtmlContent</code></pre>
  </div>
  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Web_Mvc_Component__ctor_Microsoft_AspNetCore_Mvc_Rendering_IHtmlHelper_" data-uid="C1.Web.Mvc.Component.#ctor(Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper)">
          <a class="xref" href="C1.Web.Mvc.Component.-ctor.html#C1_Web_Mvc_Component__ctor_Microsoft_AspNetCore_Mvc_Rendering_IHtmlHelper_">Component(IHtmlHelper)</a>
        </td>
        <td class="markdown level1 summary"><p>Creates one <a class="xref" href="C1.Web.Mvc.Component.html">Component</a> instance.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Web_Mvc_Component_ChildComponentsCreated" data-uid="C1.Web.Mvc.Component.ChildComponentsCreated">
          <a class="xref" href="C1.Web.Mvc.Component.ChildComponentsCreated.html#C1_Web_Mvc_Component_ChildComponentsCreated">ChildComponentsCreated</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a boolean value indicates whether child components are created.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Web_Mvc_Component_ClientComponent" data-uid="C1.Web.Mvc.Component.ClientComponent">
          <a class="xref" href="C1.Web.Mvc.Component.ClientComponent.html#C1_Web_Mvc_Component_ClientComponent">ClientComponent</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a value which represents the client control constructor with the complete namespace.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Web_Mvc_Component_Components" data-uid="C1.Web.Mvc.Component.Components">
          <a class="xref" href="C1.Web.Mvc.Component.Components.html#C1_Web_Mvc_Component_Components">Components</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the child components.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Web_Mvc_Component_HasScripts" data-uid="C1.Web.Mvc.Component.HasScripts">
          <a class="xref" href="C1.Web.Mvc.Component.HasScripts.html#C1_Web_Mvc_Component_HasScripts">HasScripts</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a boolean value indicates whether current component has the scripts which need to be rendered.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Web_Mvc_Component_Id" data-uid="C1.Web.Mvc.Component.Id">
          <a class="xref" href="C1.Web.Mvc.Component.Id.html#C1_Web_Mvc_Component_Id">Id</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the component id.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Web_Mvc_Component_UrlHelper" data-uid="C1.Web.Mvc.Component.UrlHelper">
          <a class="xref" href="C1.Web.Mvc.Component.UrlHelper.html#C1_Web_Mvc_Component_UrlHelper">UrlHelper</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the url helper.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Web_Mvc_Component_CreateChildComponents" data-uid="C1.Web.Mvc.Component.CreateChildComponents">
          <a class="xref" href="C1.Web.Mvc.Component.CreateChildComponents.html#C1_Web_Mvc_Component_CreateChildComponents">CreateChildComponents()</a>
        </td>
        <td class="markdown level1 summary"><p>Creates child components.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Web_Mvc_Component_EnsureChildComponents" data-uid="C1.Web.Mvc.Component.EnsureChildComponents">
          <a class="xref" href="C1.Web.Mvc.Component.EnsureChildComponents.html#C1_Web_Mvc_Component_EnsureChildComponents">EnsureChildComponents()</a>
        </td>
        <td class="markdown level1 summary"><p>Ensure the child components created.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Web_Mvc_Component_OnPreRender" data-uid="C1.Web.Mvc.Component.OnPreRender">
          <a class="xref" href="C1.Web.Mvc.Component.OnPreRender.html#C1_Web_Mvc_Component_OnPreRender">OnPreRender()</a>
        </td>
        <td class="markdown level1 summary"><p>This method is performed before rendering.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Web_Mvc_Component_RegisterStartupScript_System_IO_TextWriter_" data-uid="C1.Web.Mvc.Component.RegisterStartupScript(System.IO.TextWriter)">
          <a class="xref" href="C1.Web.Mvc.Component.RegisterStartupScript.html#C1_Web_Mvc_Component_RegisterStartupScript_System_IO_TextWriter_">RegisterStartupScript(TextWriter)</a>
        </td>
        <td class="markdown level1 summary"><p>Registers the start-up script.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Web_Mvc_Component_Render_System_IO_TextWriter_System_Text_Encodings_Web_HtmlEncoder_" data-uid="C1.Web.Mvc.Component.Render(System.IO.TextWriter,System.Text.Encodings.Web.HtmlEncoder)">
          <a class="xref" href="C1.Web.Mvc.Component.Render.html#C1_Web_Mvc_Component_Render_System_IO_TextWriter_System_Text_Encodings_Web_HtmlEncoder_">Render(TextWriter, HtmlEncoder)</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
      <tr>
        <td id="C1_Web_Mvc_Component_RenderScripts_System_IO_TextWriter_System_Boolean_" data-uid="C1.Web.Mvc.Component.RenderScripts(System.IO.TextWriter,System.Boolean)">
          <a class="xref" href="C1.Web.Mvc.Component.RenderScripts.html#C1_Web_Mvc_Component_RenderScripts_System_IO_TextWriter_System_Boolean_">RenderScripts(TextWriter, bool)</a>
        </td>
        <td class="markdown level1 summary"><p>Render the scripts.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Web_Mvc_Component_SerializeOptions" data-uid="C1.Web.Mvc.Component.SerializeOptions">
          <a class="xref" href="C1.Web.Mvc.Component.SerializeOptions.html#C1_Web_Mvc_Component_SerializeOptions">SerializeOptions()</a>
        </td>
        <td class="markdown level1 summary"><p>Serialize the control to a Json string.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Web_Mvc_Component_WriteTo_System_IO_TextWriter_System_Text_Encodings_Web_HtmlEncoder_" data-uid="C1.Web.Mvc.Component.WriteTo(System.IO.TextWriter,System.Text.Encodings.Web.HtmlEncoder)">
          <a class="xref" href="C1.Web.Mvc.Component.WriteTo.html#C1_Web_Mvc_Component_WriteTo_System_IO_TextWriter_System_Text_Encodings_Web_HtmlEncoder_">WriteTo(TextWriter, HtmlEncoder)</a>
        </td>
        <td class="markdown level1 summary"><p>Writer the process result of current instance to the writer.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="extensionmethods">Extension Methods</h3>
  <div>
      <a class="xref" href="C1.Web.Mvc.Fluent.IHtmlStringExtension.ToTemplate.html#C1_Web_Mvc_Fluent_IHtmlStringExtension_ToTemplate_Microsoft_AspNetCore_Html_IHtmlContent_">IHtmlStringExtension.ToTemplate(IHtmlContent)</a>
  </div>

</div>
