Show / Hide Table of Contents

    Class MessageExtensions

    Extension methods for the creation of messages.

    Inheritance
    System.Object
    MessageExtensions
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: ChameleonForms.Component
    Assembly: ChameleonForms.dll
    Syntax
    public static class MessageExtensions

    Methods

    | Improve this Doc View Source

    BeginMessage<TModel>(IForm<TModel>, MessageType, IHtmlContent)

    Creates a message.

    Declaration
    public static Message<TModel> BeginMessage<TModel>(this IForm<TModel> form, MessageType messageType, IHtmlContent heading)
    Parameters
    Type Name Description
    IForm<TModel> form

    The form the message is being created in

    MessageType messageType

    The type of message to display

    Microsoft.AspNetCore.Html.IHtmlContent heading

    The heading for the message

    Returns
    Type Description
    Message<TModel>

    The message

    Type Parameters
    Name Description
    TModel

    The view model type for the current view

    Examples

    @using (var m = f.BeginMessage(MessageType.Success, new HtmlString("<strong>The submission was successful</strong>"))) { @m.Paragraph(string.Format(&quot;Your item was successfully created with id {0}", Model.Id)) }

    | Improve this Doc View Source

    BeginMessage<TModel>(IForm<TModel>, MessageType, Func<Object, IHtmlContent>)

    Creates a message.

    Declaration
    public static Message<TModel> BeginMessage<TModel>(this IForm<TModel> form, MessageType messageType, Func<dynamic, IHtmlContent> heading)
    Parameters
    Type Name Description
    IForm<TModel> form

    The form the message is being created in

    MessageType messageType

    The type of message to display

    System.Func<System.Object, Microsoft.AspNetCore.Html.IHtmlContent> heading

    The heading for the message as a templated razor delegate

    Returns
    Type Description
    Message<TModel>

    The message

    Type Parameters
    Name Description
    TModel

    The view model type for the current view

    Examples

    @using (var m = f.BeginMessage(MessageType.Success, new HtmlString(@<strong>The submission was successful</strong>))) { @m.Paragraph(string.Format(&quot;Your item was successfully created with id {0}", Model.Id)) }

    | Improve this Doc View Source

    BeginMessage<TModel>(IForm<TModel>, MessageType, String)

    Creates a message.

    Declaration
    public static Message<TModel> BeginMessage<TModel>(this IForm<TModel> form, MessageType messageType, string heading = null)
    Parameters
    Type Name Description
    IForm<TModel> form

    The form the message is being created in

    MessageType messageType

    The type of message to display

    System.String heading

    The heading for the message

    Returns
    Type Description
    Message<TModel>

    The message

    Type Parameters
    Name Description
    TModel

    The view model type for the current view

    Examples

    @using (var m = f.BeginMessage(MessageType.Success, "Your submission was successful")) { @m.Paragraph(string.Format(&quot;Your item was successfully created with id {0}", Model.Id)) }

    • Improve this Doc
    • View Source
    Back to top © Copyright 2012-2020 MRCollective, Rob Moore, Matt Davies and the contributors to ChameleonForms.