Simplifying Related Data Access in Sitefinity’s ASP.NET Core Renderer
Accessing related content in Sitefinity’s ASP.NET Core Renderer can be tricky—but it doesn’t have to be. This blog shows how to simplify dynamic data retrieval using ViewsMetaData.json and a custom SdkItem-based DTO, enabling faster, cleaner, and more scalable development.
Sep 30, 2025

When developing dynamic components in Sitefinity, retrieving related data across complex structures can quickly become a challenge—especially when using the ASP.NET Core Renderer. A common obstacle arises when a widget needs to pull information from related content, such as a dynamic module linked through a Related Data field. Without the right approach, developers often spend unnecessary time writing extensive custom code to extract and display that data.

A more efficient solution was implemented by leveraging the capabilities of the ViewsMetaData.json file in conjunction with the flexibility of the SdkItem class. The process begins by properly mapping the related data field in the ViewsMetaData.json file, enabling the ASP.NET Core Renderer to recognize and bind the field appropriately.

From there, a custom DTO class is created by extending the SdkItem base class. This class includes properties that align with the structure of the related dynamic module, such as:

public class YourClassDTO : SdkItem
{
public Guid FieldOne { get; set; }
public string FieldTwo { get; set; }
}


With the mapping in place and the class defined, related data can be retrieved using the GetFieldValue<T>() method:

var yourClass = Model.GetFieldValue<YourClassDTO> (item, "YourFieldMapped");

This streamlined method eliminates the need for verbose custom logic and allows for clean, efficient access to related content.

The result is a simplified development workflow and faster turnaround when building dynamic, data-driven components in Sitefinity. By taking advantage of the ASP.NET Core Renderer's extensibility, developers can work more intuitively—delivering robust features with significantly less code. This approach not only reduces development time but also enhances maintainability and scalability across projects.

As the Sitefinity ecosystem continues to evolve, embracing tools like the ASP.NET Core Renderer—and learning how to optimize its features—remains essential for modern development teams focused on efficiency and performance.

Begin Your Success Story

By using this website, you agree to our use of cookies. We use cookies to provide you with a great experience and to help our website run effectively. For more, see our Privacy Policy.