Search results

Getting Started(ASP.NET MVC) in ASP.NET MVC Badge control

20 Jan 2022 / 1 minute to read

This section briefly explains about how to render Badge 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.

Starting with v16.2.0.x, if you reference Syncfusion assemblies from trial setup or from the NuGet feed, you also have to include a license key in your projects. Please refer to this link to know about registering Syncfusion license key in your ASP .NET MVC application to use our components.

Adding Badge component to the Application

Since the Badge is a CSS component there is no need to html tag helper, the component is added by using CSS classes. Add the below code to your index.cshtml page which is present under Views/Home folder.

Copied to clipboard
<h1>Badge Component <span class="e-badge">New</span></h1>

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

The following example shows a basic Badge.

Copied to clipboard
<div id='element'>
    <h1>Badge Component <span class="e-badge e-badge-primary">New</span></h1>
#element {
    display: flex;
    width: 400px;
    margin: auto;
    border: 1px solid #dddddd;
    border-radius: 3px;
    justify-content: center;
Copied to clipboard
public ActionResult Badge()
    return View();

Output be like the below.

Badge Sample

See Also

Types of Badge