Class Message<TModel>
Wraps the output of a message to display to a user.
Inherited Members
Namespace: ChameleonForms.Component
Assembly: ChameleonForms.dll
Syntax
public class Message<TModel> : FormComponent<TModel>, IFormComponent<TModel>, IHtmlContent, IDisposable
Type Parameters
Name | Description |
---|---|
TModel | The view model type for the current view |
Constructors
| Improve this Doc View SourceMessage(IForm<TModel>, MessageType, IHtmlContent)
Creates a message.
Declaration
public Message(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 |
Message(IForm<TModel>, MessageType, String)
Creates a message.
Declaration
public Message(IForm<TModel> form, MessageType messageType, string 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.String | heading | The heading for the message |
Methods
| Improve this Doc View SourceBegin()
Returns the HTML representation of the beginning of the form component.
Declaration
public override IHtmlContent Begin()
Returns
Type | Description |
---|---|
Microsoft.AspNetCore.Html.IHtmlContent | The beginning HTML for the form component |
Overrides
Dispose()
Called when form component is created within a using
block: writes the end tag(s) of the component.
Declaration
public override void Dispose()
Overrides
End()
Returns the HTML representation of the end of the form component.
Declaration
public override IHtmlContent End()
Returns
Type | Description |
---|---|
Microsoft.AspNetCore.Html.IHtmlContent | The ending HTML for the form component |
Overrides
Paragraph(IHtmlContent)
Creates the HTML for a paragraph in the message.
Declaration
public virtual IHtmlContent Paragraph(IHtmlContent paragraph)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Html.IHtmlContent | paragraph | The paragraph to output |
Returns
Type | Description |
---|---|
Microsoft.AspNetCore.Html.IHtmlContent | The HTML for the paragraph |
Paragraph(Func<Object, IHtmlContent>)
Creates the HTML for a paragraph in the message.
Declaration
public virtual IHtmlContent Paragraph(Func<dynamic, IHtmlContent> paragraph)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.Object, Microsoft.AspNetCore.Html.IHtmlContent> | paragraph | The paragraph to output as a templated razor delegate |
Returns
Type | Description |
---|---|
Microsoft.AspNetCore.Html.IHtmlContent | The HTML for the paragraph |
Paragraph(String)
Creates the HTML for a paragraph in the message.
Declaration
public virtual IHtmlContent Paragraph(string paragraph)
Parameters
Type | Name | Description |
---|---|---|
System.String | paragraph | The paragraph to output |
Returns
Type | Description |
---|---|
Microsoft.AspNetCore.Html.IHtmlContent | The HTML for the paragraph |