HtmlContentBuilderExtensions Class¶
Extension methods for Microsoft.AspNetCore.Html.IHtmlContentBuilder
.
- Namespace
Microsoft.AspNetCore.Html
- Assemblies
- Microsoft.AspNetCore.Html.Abstractions
Syntax¶
public class HtmlContentBuilderExtensions
-
class
Microsoft.AspNetCore.Html.
HtmlContentBuilderExtensions
Methods¶
-
AppendFormat
(Microsoft.AspNetCore.Html.IHtmlContentBuilder, System.IFormatProvider, System.String, System.Object[])¶ Appends the specified <em>format</em> to the existing content with information from the <em>formatProvider</em> after replacing each format item with the HTML encoded
System.String
representation of the corresponding item in the <em>args</em> array.Arguments: - builder (Microsoft.AspNetCore.Html.IHtmlContentBuilder) – The
Microsoft.AspNetCore.Html.IHtmlContentBuilder
. - formatProvider (System.IFormatProvider) – An object that supplies culture-specific formatting information.
- format (System.String) – The composite format
System.String
(see http://msdn.microsoft.com/en-us/library/txafckwd.aspx). The format string is assumed to be HTML encoded as-provided, and no further encoding will be performed. - args (System.Object<System.Object>[]) – The object array to format. Each element in the array will be formatted and then HTML encoded.
Return type: Returns: A reference to this instance after the append operation has completed.
public static IHtmlContentBuilder AppendFormat(this IHtmlContentBuilder builder, IFormatProvider formatProvider, string format, params object[] args)
- builder (Microsoft.AspNetCore.Html.IHtmlContentBuilder) – The
-
AppendFormat
(Microsoft.AspNetCore.Html.IHtmlContentBuilder, System.String, System.Object[]) Appends the specified <em>format</em> to the existing content after replacing each format item with the HTML encoded
System.String
representation of the corresponding item in the <em>args</em> array.Arguments: - builder (Microsoft.AspNetCore.Html.IHtmlContentBuilder) – The
Microsoft.AspNetCore.Html.IHtmlContentBuilder
. - format (System.String) – The composite format
System.String
(see http://msdn.microsoft.com/en-us/library/txafckwd.aspx). The format string is assumed to be HTML encoded as-provided, and no further encoding will be performed. - args (System.Object<System.Object>[]) – The object array to format. Each element in the array will be formatted and then HTML encoded.
Return type: Returns: A reference to this instance after the append operation has completed.
public static IHtmlContentBuilder AppendFormat(this IHtmlContentBuilder builder, string format, params object[] args)
- builder (Microsoft.AspNetCore.Html.IHtmlContentBuilder) – The
-
AppendHtmlLine
(Microsoft.AspNetCore.Html.IHtmlContentBuilder, System.String)¶ Appends an
System.Environment.NewLine
after appending theSystem.String
value. The value is treated as HTML encoded as-provided, and no further encoding will be performed.Arguments: - builder (Microsoft.AspNetCore.Html.IHtmlContentBuilder) – The
Microsoft.AspNetCore.Html.IHtmlContentBuilder
. - encoded (System.String) – The HTML encoded
System.String
to append.
Return type: Returns: public static IHtmlContentBuilder AppendHtmlLine(this IHtmlContentBuilder builder, string encoded)
- builder (Microsoft.AspNetCore.Html.IHtmlContentBuilder) – The
-
AppendLine
(Microsoft.AspNetCore.Html.IHtmlContentBuilder)¶ Appends an
System.Environment.NewLine
.Arguments: builder (Microsoft.AspNetCore.Html.IHtmlContentBuilder) – The Microsoft.AspNetCore.Html.IHtmlContentBuilder
.Return type: Microsoft.AspNetCore.Html.IHtmlContentBuilder Returns: The Microsoft.AspNetCore.Html.IHtmlContentBuilder
.public static IHtmlContentBuilder AppendLine(this IHtmlContentBuilder builder)
-
AppendLine
(Microsoft.AspNetCore.Html.IHtmlContentBuilder, Microsoft.AspNetCore.Html.IHtmlContent) Appends an
System.Environment.NewLine
after appending theMicrosoft.AspNetCore.Html.IHtmlContent
value.Arguments: - builder (Microsoft.AspNetCore.Html.IHtmlContentBuilder) – The
Microsoft.AspNetCore.Html.IHtmlContentBuilder
. - content (Microsoft.AspNetCore.Html.IHtmlContent) – The
Microsoft.AspNetCore.Html.IHtmlContent
to append.
Return type: Returns: public static IHtmlContentBuilder AppendLine(this IHtmlContentBuilder builder, IHtmlContent content)
- builder (Microsoft.AspNetCore.Html.IHtmlContentBuilder) – The
-
AppendLine
(Microsoft.AspNetCore.Html.IHtmlContentBuilder, System.String) Appends an
System.Environment.NewLine
after appending theSystem.String
value. The value is treated as unencoded as-provided, and will be HTML encoded before writing to output.Arguments: - builder (Microsoft.AspNetCore.Html.IHtmlContentBuilder) – The
Microsoft.AspNetCore.Html.IHtmlContentBuilder
. - unencoded (System.String) – The
System.String
to append.
Return type: Returns: public static IHtmlContentBuilder AppendLine(this IHtmlContentBuilder builder, string unencoded)
- builder (Microsoft.AspNetCore.Html.IHtmlContentBuilder) – The
-
SetContent
(Microsoft.AspNetCore.Html.IHtmlContentBuilder, System.String)¶ Sets the content to the
System.String
value. The value is treated as unencoded as-provided, and will be HTML encoded before writing to output.Arguments: - builder (Microsoft.AspNetCore.Html.IHtmlContentBuilder) – The
Microsoft.AspNetCore.Html.IHtmlContentBuilder
. - unencoded (System.String) – The
System.String
value that replaces the content.
Return type: Returns: public static IHtmlContentBuilder SetContent(this IHtmlContentBuilder builder, string unencoded)
- builder (Microsoft.AspNetCore.Html.IHtmlContentBuilder) – The
-
SetHtmlContent
(Microsoft.AspNetCore.Html.IHtmlContentBuilder, Microsoft.AspNetCore.Html.IHtmlContent)¶ Sets the content to the
Microsoft.AspNetCore.Html.IHtmlContent
value.Arguments: - builder (Microsoft.AspNetCore.Html.IHtmlContentBuilder) – The
Microsoft.AspNetCore.Html.IHtmlContentBuilder
. - content (Microsoft.AspNetCore.Html.IHtmlContent) – The
Microsoft.AspNetCore.Html.IHtmlContent
value that replaces the content.
Return type: Returns: public static IHtmlContentBuilder SetHtmlContent(this IHtmlContentBuilder builder, IHtmlContent content)
- builder (Microsoft.AspNetCore.Html.IHtmlContentBuilder) – The
-
SetHtmlContent
(Microsoft.AspNetCore.Html.IHtmlContentBuilder, System.String) Sets the content to the
System.String
value. The value is treated as HTML encoded as-provided, and no further encoding will be performed.Arguments: - builder (Microsoft.AspNetCore.Html.IHtmlContentBuilder) – The
Microsoft.AspNetCore.Html.IHtmlContentBuilder
. - encoded (System.String) – The HTML encoded
System.String
that replaces the content.
Return type: Returns: public static IHtmlContentBuilder SetHtmlContent(this IHtmlContentBuilder builder, string encoded)
- builder (Microsoft.AspNetCore.Html.IHtmlContentBuilder) – The
-