• Home
  • Articles
  • API Documentation
Search Results for

    Show / Hide Table of Contents
    • ToSic.Razor.Blade
      • IHtmlTag
      • IHtmlTagsService
      • IScrub
      • Tag
      • Tags
      • Text
    • ToSic.Razor.Html5
      • A
      • Abbr
      • Address
      • Area
      • Article
      • Aside
      • Audio
      • B
      • Base
      • Bdi
      • Bdo
      • Blockquote
      • Br
      • Button
      • Canvas
      • Caption
      • Cite
      • Code
      • Col
      • Colgroup
      • Comment
      • Data
      • Datalist
      • Dd
      • Del
      • Details
      • Dfn
      • Dialog
      • Div
      • Dl
      • Dt
      • Em
      • Embed
      • Fieldset
      • Figcaption
      • Figure
      • Footer
      • Form
      • H1
      • H2
      • H3
      • H4
      • H5
      • H6
      • Head
      • Header
      • Hr
      • I
      • Icon
      • Iframe
      • Img
      • Input
      • Ins
      • Kbd
      • Label
      • Legend
      • Li
      • Link
      • Main
      • Map
      • Mark
      • Meta
      • MetaOg
      • Meter
      • Nav
      • Noscript
      • Object
      • Ol
      • Optgroup
      • Option
      • Output
      • P
      • Param
      • Picture
      • Pre
      • Progress
      • Q
      • Rp
      • Rt
      • Ruby
      • S
      • Samp
      • Script
      • ScriptJsonLd
      • Section
      • Select
      • Small
      • Source
      • Span
      • Strong
      • Style
      • Sub
      • Summary
      • Sup
      • Svg
      • Table
      • Tbody
      • Td
      • Template
      • Textarea
      • Tfoot
      • Th
      • Thead
      • Time
      • Tr
      • Track
      • U
      • Ul
      • Var
      • Video
      • Wbr
    • ToSic.Razor.Markup
      • Attribute
      • AttributeOptions
      • Attributes
      • ITag
      • Tag<T>
      • TagBase
      • TagChildren
      • TagCustom
      • TagList
      • TagOptions
      • TagText
    • ToSic.Razor.StartUp
      • StartUp

    Class AttributeOptions

    Configure how attributes will be serialized. It's a read-only object to ensure fluid APIs. Properties cannot be modified. To modify a property, create a new one to clone the settings of the previous.

    Inheritance
    System.Object
    AttributeOptions
    Namespace: ToSic.Razor.Markup
    Assembly: ToSic.Razor.dll
    Syntax
    public class AttributeOptions
    Remarks

    In v4.0 it was changed to be read-only for reliably fluid APIs.

    Constructors

    | Improve this Doc View Source

    AttributeOptions(AttributeOptions, String, Nullable<Boolean>, Nullable<Boolean>, Nullable<Boolean>)

    Declaration
    public AttributeOptions(AttributeOptions original = null, string quote = null, bool? encodeQuotes = null, bool? keepEmpty = null, bool? dropValueIfNull = null)
    Parameters
    Type Name Description
    AttributeOptions original
    System.String quote
    System.Nullable<System.Boolean> encodeQuotes
    System.Nullable<System.Boolean> keepEmpty
    System.Nullable<System.Boolean> dropValueIfNull

    Fields

    | Improve this Doc View Source

    DefaultDropValueIfNull

    By default a null-value will result in an attribute-name only.

    Declaration
    public const bool DefaultDropValueIfNull = true
    Field Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    DefaultEncodeQuotes

    By default quotes will not be encoded if this results in valid html.

    Declaration
    public const bool DefaultEncodeQuotes = false
    Field Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    DefaultKeepEmpty

    By default, empty attributes are preserved.

    Declaration
    public const bool DefaultKeepEmpty = true
    Field Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    DefaultQuote

    By default, use the &apos; quote for attributes since it allows for storing json in attributes which is fairly common.

    Declaration
    public const string DefaultQuote = "'"
    Field Value
    Type Description
    System.String

    Properties

    | Improve this Doc View Source

    DropValueIfNull

    Drop the value part of the attribute if the value would be null. When true, name=null will result in name - when false it will be name=&apos;&apos;

    Declaration
    public bool DropValueIfNull { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    EncodeQuotes

    Encode quotes or apostrophes in attributes which clearly don't need encoding

    Declaration
    public bool EncodeQuotes { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    KeepEmpty

    Place empty attributes on the tag anyhow.

    Declaration
    public bool KeepEmpty { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Quote

    What character is used for wrapping attribute values

    Declaration
    public string Quote { get; }
    Property Value
    Type Description
    System.String
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX