• Home
  • Articles
  • API Documentation

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

    Interface IHtmlPage

    Standardizes what an HtmlPage object can do across platforms.

    Namespace: ToSic.Razor.Interfaces
    Assembly: ToSic.Razor.Dnn.dll
    Syntax
    [PrivateApi]
    public interface IHtmlPage
    Remarks

    WARNING - this was an implementation for DNN and doesn't use Dependency injection Because of this we strongly recommend against using it. We assume this interface is actually not used anywhere, so don't start now :). Use the Connect.Koi implementation instead.

    Properties

    | Improve this Doc View Source

    Description

    Get/Set description of this page Will return null if not running in a page context.

    Declaration
    string Description { get; set; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    Keywords

    Get/Set keywords of this page Will return null if not running in a page context.

    Declaration
    string Keywords { get; set; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    Title

    The current page title Will return null if not running in a page context.

    Declaration
    string Title { get; set; }
    Property Value
    Type Description
    System.String

    Methods

    | Improve this Doc View Source

    AddBase(String)

    Add a standard base header tag. new in 3.0

    Declaration
    void AddBase(string url = null)
    Parameters
    Type Name Description
    System.String url

    the optional url for the base tag - if null, will default to the real url for the current page

    | Improve this Doc View Source

    AddIcon(String, String, String, Int32, String)

    Add an icon tag to the page new in 3.0

    Declaration
    void AddIcon(string path, string doNotRelyOnParameterOrder = "Dummy-Parameter - don't provide this, but do name all other parameters in this call using paramName: value", string rel = "", int size = 0, string type = null)
    Parameters
    Type Name Description
    System.String path

    Path to the image/icon file

    System.String doNotRelyOnParameterOrder

    This is a dummy parameter to force the developer to name the remaining parameters - like size: 75 etc. This allows us to add more parameters in future without worrying that existing code could break.

    System.String rel

    the rel-text, default is 'icon'. common terms are also 'shortcut icon' or 'apple-touch-icon'

    System.Int32 size

    Will be used in size='#x#' tag; only relevant if you want to provide multiple separate sizes

    System.String type

    An optional type. If not provided, will be auto-detected from known types or remain empty

    | Improve this Doc View Source

    AddIconSet(String, String, Object, IEnumerable<String>, IEnumerable<Int32>)

    Add a set of icons to the page new in 3.0

    Declaration
    void AddIconSet(string path, string doNotRelyOnParameterOrder = "Dummy-Parameter - don't provide this, but do name all other parameters in this call using paramName: value", object favicon = null, IEnumerable<string> rels = null, IEnumerable<int> sizes = null)
    Parameters
    Type Name Description
    System.String path

    Path to the image/icon file

    System.String doNotRelyOnParameterOrder

    This is a dummy parameter to force the developer to name the remaining parameters - like size: 75 etc. This allows us to add more parameters in future without worrying that existing code could break.

    System.Object favicon

    path to favicon, default is '/favicon.ico'

    System.Collections.Generic.IEnumerable<System.String> rels
    System.Collections.Generic.IEnumerable<System.Int32> sizes
    | Improve this Doc View Source

    AddJsonLd(Object)

    Add a JSON-LD header according https://developers.google.com/search/docs/guides/intro-structured-data

    Declaration
    void AddJsonLd(object jsonObject)
    Parameters
    Type Name Description
    System.Object jsonObject

    A object which will be converted to JSON. We recommend using dictionaries to build the object.

    | Improve this Doc View Source

    AddJsonLd(String)

    Add a JSON-LD header according https://developers.google.com/search/docs/guides/intro-structured-data

    Declaration
    void AddJsonLd(string jsonString)
    Parameters
    Type Name Description
    System.String jsonString

    A prepared JSON string

    | Improve this Doc View Source

    AddMeta(String, String)

    Add a standard meta header tag. You may also want AddOpenGraph or AddJsonLd

    Declaration
    void AddMeta(string name, string content)
    Parameters
    Type Name Description
    System.String name
    System.String content
    | Improve this Doc View Source

    AddOpenGraph(String, String)

    Add an open-graph header according to http://ogp.me/

    Declaration
    void AddOpenGraph(string property, string content)
    Parameters
    Type Name Description
    System.String property

    Open Graph property name, like title or image:width. 'og:' is automatically prefixed if not included

    System.String content

    value of this property

    | Improve this Doc View Source

    AddToHead(String)

    Add a tag to the header of the page Will simply not do anything if an error occurs, like if the page object doesn't exist

    Declaration
    void AddToHead(string tag)
    Parameters
    Type Name Description
    System.String tag
    | Improve this Doc View Source

    AddToHead(TagBase)

    Add a tag object to the header of the page Will simply not do anything if an error occurs, like if the page object doesn't exist

    Declaration
    void AddToHead(TagBase tag)
    Parameters
    Type Name Description
    TagBase tag
    Remarks

    New in 2.1

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