Severities in Message control

27 Feb 20231 minute to read

The severity denotes the importance and context of the message to the user. The message contains different severity types. Use the Severity property to display the messages with different severity levels.

The available severity types are Normal, Success, Info, Warning and Error. The default severity type for messages is Normal.

The following example demonstrates the severity of the messages.

<div class="msg-default-section">
    <div class="msg-content-section">
        @Html.EJS().Message("msg-default").Severity(Severity.Normal).Content("Editing is restricted").Render()
        @Html.EJS().Message("msg-info").Severity(Severity.Info).Content("Please read the comments carefully").Render()
        @Html.EJS().Message("msg-success").Severity(Severity.Success).Content("Your message has been sent successfully").Render()
        @Html.EJS().Message("msg-warning").Severity(Severity.Warning).Content("There was a problem with your network connection").Render()
        @Html.EJS().Message("msg-error").Severity(Severity.Error).Content("A problem occurred while submitting your data").Render()
    </div>
</div>

<style>
  .msg-default-section .content-section {
    margin: 0 auto;
    max-width: 450px;
    padding-top: 10px;
  }

  .msg-default-section .e-message {
    margin: 10px 0;
  }
</style>

Message Control Severity Icon