17 Feb 20221 minute to read
This section briefly explains about how to renderAvatar
component in your ASP.NET MVC application. You can
referASP.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 thislink to know about registering Syncfusion license key in your ASP .NET MVC application to use our components.
Since theAvatar
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 yourindex.cshtml
page which is present underViews/Home
folder.
<spanclass="e-avatar">GR</span>
After successful compilation of your application, simply pressF5
to run the application.
The following example shows a basic Avatar.
<divid='element'><spanclass="e-avatar e-avatar-xlarge"></span><spanclass="e-avatar e-avatar-large"></span><spanclass="e-avatar"></span><spanclass="e-avatar e-avatar-small"></span><spanclass="e-avatar e-avatar-xsmall"></span></div><style>#element { display: block; width: 300px; margin: 130px auto; border-radius: 3px; justify-content: center;}.e-avatar { background-image: url(./pic01.png); margin: 2px;}</style>
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Web;usingSystem.Web.Mvc;namespaceEJ2MVCSampleBrowser.Controllers{publicclassHomeController:Controller{publicActionResultIndex(){returnView();}}}
Output be like the below.