Class MessageExtensions
Extension methods for the creation of messages.
Inheritance
Inherited Members
Namespace: ChameleonForms.Component
Assembly: ChameleonForms.dll
Syntax
public static class MessageExtensions
Methods
| Improve this Doc View SourceBeginMessage<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("Your item was successfully created with id {0}", Model.Id)) }
| Improve this Doc View SourceBeginMessage<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("Your item was successfully created with id {0}", Model.Id)) }
| Improve this Doc View SourceBeginMessage<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("Your item was successfully created with id {0}", Model.Id)) }