Search results

Getting started with ASP.NET Core Toast control

This section briefly explains about how to render Toast control in your ASP.NET Core application. You can refer ASP.NET Core 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.
tagHelper
controller.cs
<ejs-toast id="element" title="Matt sent you a friend request" content="You have a new friend request yet to accept"></ejs-toast>
<script type="text/javascript">
    setTimeout(
        () => {
            var toastObj = document.getElementById('element').ej2_instances[0];
            toastObj.target = document.body;
            toastObj.show();
        }, 1000);
</script>
public class HomeController : Controller
{

    public ActionResult Index()
    {
        return View();
    }
}

Output be like the below.

Toast control

See Also