ASP.NET Core - EJ2

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ToastBuilder - ASP.NETCore-EJ2 API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ToastBuilder

    Inheritance
    System.Object
    ControlBuilder
    ToastBuilder
    Inherited Members
    ControlBuilder.Context
    Namespace: Syncfusion.EJ2.Notifications
    Assembly: Syncfusion.EJ2.dll
    Syntax
    public class ToastBuilder : ControlBuilder

    Constructors

    ToastBuilder()

    Declaration
    public ToastBuilder()

    ToastBuilder(Toast)

    Declaration
    public ToastBuilder(Toast model)
    Parameters
    Type Name Description
    Toast model

    Fields

    model

    Declaration
    public Toast model
    Field Value
    Type Description
    Toast

    Properties

    HtmlAttr

    Declaration
    public IDictionary<string, object> HtmlAttr { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.IDictionary<System.String, System.Object>

    ID

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

    Output

    Declaration
    public override TextWriter Output { get; set; }
    Property Value
    Type Description
    System.IO.TextWriter
    Overrides
    ControlBuilder.Output

    Methods

    Animation(ToastToastAnimationSettings)

    Specifies the animation configuration settings for showing and hiding the Toast.

    Declaration
    public ToastBuilder Animation(ToastToastAnimationSettings animation)
    Parameters
    Type Name Description
    ToastToastAnimationSettings animation
    Returns
    Type Description
    ToastBuilder

    Animation(Action<ToastToastAnimationSettingsBuilder>)

    Declaration
    public ToastBuilder Animation(Action<ToastToastAnimationSettingsBuilder> animation)
    Parameters
    Type Name Description
    System.Action<ToastToastAnimationSettingsBuilder> animation
    Returns
    Type Description
    ToastBuilder

    BeforeOpen(String)

    Triggers the event before the toast shown.

    Declaration
    public ToastBuilder BeforeOpen(string beforeOpen)
    Parameters
    Type Name Description
    System.String beforeOpen
    Returns
    Type Description
    ToastBuilder

    BeforeSanitizeHtml(String)

    Event triggers before sanitize the value.

    Declaration
    public ToastBuilder BeforeSanitizeHtml(string beforeSanitizeHtml)
    Parameters
    Type Name Description
    System.String beforeSanitizeHtml
    Returns
    Type Description
    ToastBuilder

    Buttons(Action<ToastButtonModelPropBuilder>)

    Declaration
    public ToastBuilder Buttons(Action<ToastButtonModelPropBuilder> buttons)
    Parameters
    Type Name Description
    System.Action<ToastButtonModelPropBuilder> buttons
    Returns
    Type Description
    ToastBuilder

    Buttons(List<ToastButtonModelProp>)

    Specifies the collection of Toast action buttons to be rendered with the given Button model properties and its click action handler.

    Declaration
    public ToastBuilder Buttons(List<ToastButtonModelProp> buttons)
    Parameters
    Type Name Description
    System.Collections.Generic.List<ToastButtonModelProp> buttons
    Returns
    Type Description
    ToastBuilder

    Click(String)

    The event will be fired while clicking on the Toast.

    Declaration
    public ToastBuilder Click(string click)
    Parameters
    Type Name Description
    System.String click
    Returns
    Type Description
    ToastBuilder

    Close(String)

    Trigger the event after the Toast hides.

    Declaration
    public ToastBuilder Close(string close)
    Parameters
    Type Name Description
    System.String close
    Returns
    Type Description
    ToastBuilder

    Content(String)

    Specifies the content to be displayed on the Toast. Accepts selectors, string values and HTML elements.

    Declaration
    public ToastBuilder Content(string content)
    Parameters
    Type Name Description
    System.String content
    Returns
    Type Description
    ToastBuilder

    ContentTemplate(Action<Object>)

    Declaration
    public ToastBuilder ContentTemplate(Action<object> template)
    Parameters
    Type Name Description
    System.Action<System.Object> template
    Returns
    Type Description
    ToastBuilder

    ContentTemplate(Func<Object, Object>)

    Declaration
    public ToastBuilder ContentTemplate(Func<object, object> template)
    Parameters
    Type Name Description
    System.Func<System.Object, System.Object> template
    Returns
    Type Description
    ToastBuilder

    Created(String)

    Triggers the event after the Toast gets created.

    Declaration
    public ToastBuilder Created(string created)
    Parameters
    Type Name Description
    System.String created
    Returns
    Type Description
    ToastBuilder

    CssClass(String)

    Defines single/multiple classes (separated by space) to be used for customization of Toast.

    Declaration
    public ToastBuilder CssClass(string cssClass)
    Parameters
    Type Name Description
    System.String cssClass
    Returns
    Type Description
    ToastBuilder

    Destroyed(String)

    Triggers the event after the Toast gets destroyed.

    Declaration
    public ToastBuilder Destroyed(string destroyed)
    Parameters
    Type Name Description
    System.String destroyed
    Returns
    Type Description
    ToastBuilder

    EnableHtmlSanitizer(Boolean)

    Defines whether to allow the cross-scripting site or not.

    Declaration
    public ToastBuilder EnableHtmlSanitizer(bool enableHtmlSanitizer = true)
    Parameters
    Type Name Description
    System.Boolean enableHtmlSanitizer
    Returns
    Type Description
    ToastBuilder

    EnablePersistence(Boolean)

    Enable or disable persisting component's state between page reloads.

    Declaration
    public ToastBuilder EnablePersistence(bool enablePersistence = true)
    Parameters
    Type Name Description
    System.Boolean enablePersistence
    Returns
    Type Description
    ToastBuilder

    EnableRtl(Boolean)

    Enable or disable rendering component in right to left direction.

    Declaration
    public ToastBuilder EnableRtl(bool enableRtl = true)
    Parameters
    Type Name Description
    System.Boolean enableRtl
    Returns
    Type Description
    ToastBuilder

    ExtendedTimeout(Double)

    Specifies the Toast display time duration after interacting with the Toast.

    Declaration
    public ToastBuilder ExtendedTimeout(double extendedTimeout)
    Parameters
    Type Name Description
    System.Double extendedTimeout
    Returns
    Type Description
    ToastBuilder

    Height(Double)

    Specifies the height of the Toast in pixels/number/percentage. Number value is considered as pixels.

    Declaration
    public ToastBuilder Height(double height)
    Parameters
    Type Name Description
    System.Double height
    Returns
    Type Description
    ToastBuilder

    Height(String)

    Specifies the height of the Toast in pixels/number/percentage. Number value is considered as pixels.

    Declaration
    public ToastBuilder Height(string height)
    Parameters
    Type Name Description
    System.String height
    Returns
    Type Description
    ToastBuilder

    HtmlAttributes(Object)

    Allows additional HTML attributes such as title, name, etc., and accepts n number of attributes in a key-value pair format.

    Declaration
    public ToastBuilder HtmlAttributes(object htmlAttributes)
    Parameters
    Type Name Description
    System.Object htmlAttributes
    Returns
    Type Description
    ToastBuilder

    Icon(String)

    Defines CSS classes to specify an icon for the Toast which is to be displayed at top left corner of the Toast.

    Declaration
    public ToastBuilder Icon(string icon)
    Parameters
    Type Name Description
    System.String icon
    Returns
    Type Description
    ToastBuilder

    Locale(String)

    Overrides the global culture and localization value for this component. Default global culture is 'en-US'.

    Declaration
    public ToastBuilder Locale(string locale)
    Parameters
    Type Name Description
    System.String locale
    Returns
    Type Description
    ToastBuilder

    NewestOnTop(Boolean)

    Specifies the newly created Toast message display order while multiple toast's are added to page one after another. By default, newly added Toast will be added after old Toast's.

    Declaration
    public ToastBuilder NewestOnTop(bool newestOnTop = true)
    Parameters
    Type Name Description
    System.Boolean newestOnTop
    Returns
    Type Description
    ToastBuilder

    Open(String)

    Triggers the event after the Toast shown on the target container.

    Declaration
    public ToastBuilder Open(string open)
    Parameters
    Type Name Description
    System.String open
    Returns
    Type Description
    ToastBuilder

    Position(ToastToastPosition)

    Specifies the position of the Toast message to be displayed within target container. In the case of multiple Toast display, new Toast position will not update on dynamic change of property values until the old Toast messages removed. X values are: Left , Right ,Center Y values are: Top , Bottom

    Declaration
    public ToastBuilder Position(ToastToastPosition position)
    Parameters
    Type Name Description
    ToastToastPosition position
    Returns
    Type Description
    ToastBuilder

    Position(Action<ToastToastPositionBuilder>)

    Declaration
    public ToastBuilder Position(Action<ToastToastPositionBuilder> position)
    Parameters
    Type Name Description
    System.Action<ToastToastPositionBuilder> position
    Returns
    Type Description
    ToastBuilder

    Render()

    Declaration
    public HtmlString Render()
    Returns
    Type Description
    Microsoft.AspNetCore.Html.HtmlString

    ShowCloseButton(Boolean)

    Specifies whether to show the close button in Toast message to close the Toast.

    Declaration
    public ToastBuilder ShowCloseButton(bool showCloseButton = true)
    Parameters
    Type Name Description
    System.Boolean showCloseButton
    Returns
    Type Description
    ToastBuilder

    ShowProgressBar(Boolean)

    Specifies whether to show the progress bar to denote the Toast message display timeout.

    Declaration
    public ToastBuilder ShowProgressBar(bool showProgressBar = true)
    Parameters
    Type Name Description
    System.Boolean showProgressBar
    Returns
    Type Description
    ToastBuilder

    Target(String)

    Specifies the target container where the Toast to be displayed. Based on the target, the positions such as Left, Top will be applied to the Toast. The default value is null, which refers the document.body element.

    Declaration
    public ToastBuilder Target(string target)
    Parameters
    Type Name Description
    System.String target
    Returns
    Type Description
    ToastBuilder

    Template(String)

    Specifies the HTML element/element ID as a string that can be displayed as a Toast. The given template is taken as preference to render the Toast, even if the built-in properties such as title and content are defined.

    Declaration
    public ToastBuilder Template(string template)
    Parameters
    Type Name Description
    System.String template
    Returns
    Type Description
    ToastBuilder

    TimeOut(Double)

    Specifies the Toast display time duration on the page in milliseconds.

    • Once the time expires, Toast message will be removed.
    • Setting 0 as a time out value displays the Toast on the page until the user closes it manually.
    Declaration
    public ToastBuilder TimeOut(double timeOut)
    Parameters
    Type Name Description
    System.Double timeOut
    Returns
    Type Description
    ToastBuilder

    Title(String)

    Specifies the title to be displayed on the Toast. Works only with string values.

    Declaration
    public ToastBuilder Title(string title)
    Parameters
    Type Name Description
    System.String title
    Returns
    Type Description
    ToastBuilder

    Width(Double)

    Specifies the width of the Toast in pixels/numbers/percentage. Number value is considered as pixels. In mobile devices, default width is considered as 100%.

    Declaration
    public ToastBuilder Width(double width)
    Parameters
    Type Name Description
    System.Double width
    Returns
    Type Description
    ToastBuilder

    Width(String)

    Specifies the width of the Toast in pixels/numbers/percentage. Number value is considered as pixels. In mobile devices, default width is considered as 100%.

    Declaration
    public ToastBuilder Width(string width)
    Parameters
    Type Name Description
    System.String width
    Returns
    Type Description
    ToastBuilder
    Back to top Generated by DocFX
    Copyright © 2001 - 2021 Syncfusion Inc. All Rights Reserved