ViewComponentDescriptor.ShortName Property

Definition

Gets or sets the short name.

C#
public string ShortName { get; set; }

Property Value

Remarks

The short name is defaulted to the name of the view component class. If the view component class uses ViewComponent as a suffix, the suffix will be omitted from the ShortName.

Class Name: Contoso.Products.LoginViewComponent View Component ShortName: Login
Class Name: Contoso.Blog.Tags View Component ShortName: Tags

If Name is used to set a name, then the last segment of the value (using '.' as a separate) will be used as the ShortName.

[ViewComponent(Name = "Contoso.Forum.UsersOnline")] public class OnlineUsersViewComponent { } View Component ShortName: UsersOnline

Applies to

Produkt Verzie
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0