Search results

Getting started with ASP.NET MVC Toast control

20 Jan 2022 / 1 minute to read

This section briefly explains about how to render Toast component in your ASP.NET MVC application. You can refer ASP.NET MVC Getting Started documentation page for introduction part of the system requirements and configure the common specifications.

Adding Toast control to the Application

  • Now open your view page to render Toast control.
Copied to clipboard
@Html.EJS().Toast("element").Title("Matt sent you a friend request").Content("You have a new friend request yet to accept").Render()
<script type="text/javascript">
    setTimeout(() => {
        var toastObj = document.getElementById('element').ej2_instances[0]; = document.body;;
    }, 1000);
Copied to clipboard
public class HomeController : Controller

    public ActionResult Index()
        return View();

Output be like the below.

Toast control

See Also