• Home
  • Articles
  • API Documentation
Search Results for

    Show / Hide Table of Contents
    • ToSic.Razor.Blade
      • HtmlPage
      • 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
      • AttributeBase
      • AttributeList
      • AttributeListBase
      • AttributeOptions
      • ChildTags
      • ITag
      • Tag<T>
      • TagBase
      • TagCustom
      • TagList
      • TagOptions
    • ToSic.Razor.StartUp
      • StartUp

    Namespace ToSic.Razor.Blade

    This is the main namespace you will be working with. Add it to your page like this:

    @using ToSic.Razor.Blade;
    

    After that you can simply use the commands - so here's a super simple cshtml file:

    @using ToSic.Razor.Blade;
    <div>
        @Text.Ellipsis("this text is much too long &amp; will need to be truncated", 25)
    </div>
    

    Classes

    HtmlPage

    Access the surrounding page and read/modify some properties, and add various kinds of headers to the <head> of the current page.

    Tag

    Helper to quickly generate all HTML5 tags with a Tag.Img() or Tag.Table() syntax. This is the easiest and safest way to use in in Razor templates because you won't have naming issues etc.
    The objects are smart - for example this will automatically uri-encode 😎

    Tag.Img().Src("ünsafe.jpg")

    Important: Tag can easily be confused with the Tags object.
    new in 3.0

    Tags

    The Tags-API is for manipulating strings which contain html or should contain html

    • like stripping away tags, converting &lt;br> tags to new-lines and similar.
      Important: Tags can easily be confused with the Tag object.

    Text

    Many simple commands to work with Text / Strings

    Interfaces

    IScrub

    IScrub helps wash/clean html from things you want removed. It can take care of all tags, just specific tags or certain attributes.

    Note that it is implemented as an interface, so you must use Dependency Injection to get it.

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