Getting Started with ASP.NET Core Avatar Control

7 Nov 20231 minute to read

This section briefly explains about how to include ASP.NET Core Avatar control in your ASP.NET Core application using Visual Studio.


System requirements for ASP.NET Core controls

Create ASP.NET Core web application with Razor pages

Add stylesheet

Here, the theme is referred using CDN inside the <head> of ~/Pages/Shared/_Layout.cshtml file as follows,

    <!-- Syncfusion ASP.NET Core controls styles -->
    <link rel="stylesheet" href="" />


Checkout the Themes topic to learn different ways (CDN, NPM package, and CRG) to refer styles in ASP.NET Core application, and to have the expected appearance for Syncfusion ASP.NET Core controls.

Add ASP.NET Core Avatar control

Now, add the Syncfusion ASP.NET Core Avatar tag helper in ~/Pages/Index.cshtml page.

<div id='element'>
    <span class="e-avatar e-avatar-xlarge"></span>
    <span class="e-avatar e-avatar-large"></span>
    <span class="e-avatar"></span>
    <span class="e-avatar e-avatar-small"></span>
    <span class="e-avatar e-avatar-xsmall"></span>

#element {
    display: block;
    width: 300px;
    margin: 130px auto;
    border-radius: 3px;
    justify-content: center;

.e-avatar {
    background-image: url(@Url.Content("~/css/avatar/images/pic01.png"));
    margin: 2px;

ASP.NET Core Avatar Control


View Sample in GitHub.

See also