• 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

    Interface IHtmlTag

    Public interface for all Html5Tags

    Inherited Members
    ITag.TagAttributes
    ITag.TagChildren
    ITag.TagOptions
    ITag.TagName
    ITag.ToString()
    ITag.TagStart
    ITag.TagEnd
    System.Collections.Generic.IEnumerable<ToSic.Razor.Markup.ITag>.GetEnumerator()
    Namespace: ToSic.Razor.Blade
    Assembly: ToSic.Razor.dll
    Syntax
    public interface IHtmlTag : ITag, IEnumerable<ITag>, IEnumerable

    Methods

    | Improve this Doc View Source

    Add(Object[])

    Add contents to this tag - at the end of the already added contents. If you want to replace the contents, use Wrap() instead

    Declaration
    IHtmlTag Add(params object[] children)
    Parameters
    Type Name Description
    System.Object[] children

    a variable amount of tags / strings to add to the contents of this tag

    Returns
    Type Description
    IHtmlTag

    A new IHtmlTag object with the changes, allowing a fluid API

    | Improve this Doc View Source

    Attr(Object)

    Quickly add an attribute it always returns the tag itself again, allowing chaining of multiple add-calls

    Declaration
    IHtmlTag Attr(object nameWithValue)
    Parameters
    Type Name Description
    System.Object nameWithValue

    Object which can be ToString()ed

    Returns
    Type Description
    IHtmlTag

    A new IHtmlTag object with the changes, allowing a fluid API

    | Improve this Doc View Source

    Attr(String, Object, String)

    Quickly add an attribute it always returns the tag itself again, allowing chaining of multiple add-calls

    Declaration
    IHtmlTag Attr(string name, object value = null, string appendSeparator = null)
    Parameters
    Type Name Description
    System.String name

    the attribute name, or a complete value like "name='value'"

    System.Object value

    optional value - if the attribute already exists, it will be appended

    System.String appendSeparator

    attribute appendSeparator in case the value is appended

    Returns
    Type Description
    IHtmlTag

    A new IHtmlTag object with the changes, allowing a fluid API

    | Improve this Doc View Source

    Class(String)

    class attribute

    Declaration
    IHtmlTag Class(string value)
    Parameters
    Type Name Description
    System.String value
    Returns
    Type Description
    IHtmlTag

    A new IHtmlTag object with the changes, allowing a fluid API

    | Improve this Doc View Source

    Data(String, Object)

    Add a data-... attribute

    Declaration
    IHtmlTag Data(string name, object value = null)
    Parameters
    Type Name Description
    System.String name

    the term behind data-, so "name" becomes "data-name". If empty, will just create a "data" attribute

    System.Object value

    string or object, objects will be json serialized

    Returns
    Type Description
    IHtmlTag

    A new IHtmlTag object with the changes, allowing a fluid API

    | Improve this Doc View Source

    Id(String)

    ID - set multiple times always overwrites previous ID

    Declaration
    IHtmlTag Id(string id)
    Parameters
    Type Name Description
    System.String id
    Returns
    Type Description
    IHtmlTag

    A new IHtmlTag object with the changes, allowing a fluid API

    | Improve this Doc View Source

    On(String, Object)

    Add a onEventName attribute for javascript events

    Declaration
    IHtmlTag On(string name, object value = null)
    Parameters
    Type Name Description
    System.String name

    the term behind data-, so "name" becomes "data-name"

    System.Object value

    string or object, objects will be json serialized

    Returns
    Type Description
    IHtmlTag

    A new IHtmlTag object with the changes, allowing a fluid API

    | Improve this Doc View Source

    Style(String)

    style attribute. If called multiple times, will append styles.

    Declaration
    IHtmlTag Style(string value)
    Parameters
    Type Name Description
    System.String value

    Style to add

    Returns
    Type Description
    IHtmlTag

    A new IHtmlTag object with the changes, allowing a fluid API

    | Improve this Doc View Source

    Title(String)

    title attribute

    Declaration
    IHtmlTag Title(string value)
    Parameters
    Type Name Description
    System.String value

    new title to set

    Returns
    Type Description
    IHtmlTag

    A new IHtmlTag object with the changes, allowing a fluid API

    | Improve this Doc View Source

    Wrap(Object[])

    Wrap the tag around the new content, so this replaces all the content with what you give it

    Declaration
    IHtmlTag Wrap(params object[] content)
    Parameters
    Type Name Description
    System.Object[] content

    a variable amount of tags / strings to add to the contents of this tag

    Returns
    Type Description
    IHtmlTag

    A new IHtmlTag object with the changes, allowing a fluid API

    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX