Search results

Getting Started

This section briefly explains about how to include a simple Button 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.

Add Button to the project

We are going to render Button component in Index.cshtml page.

razor
default.cs
@Html.EJS().Button("element").Content("Button").Render()
public IActionResult Index()
    {
            return View();
    }

Output be like the below.

Button Sample

Run the application

After successful compilation of your application, simply press F5 to run the application.

The following example shows a default rendering of Button.

razor
default.cs
@Html.EJS().Button("element").Content("Button").Render()
public IActionResult Index()
    {
            return View();
    }

Change Button type

To change the default Button to flat Button, set the cssClass property to e-flat.

razor
flatbutton.cs
@Html.EJS().Button("element").Content("Button").CssClass("e-flat").Render()
public IActionResult FlatButton()
    {
            return View();
    }

See Also