Logo
The Examples for ASP.NET Core SDK page has loaded.

Examples for ASP.NET Core SDK

The provided code is intended as a guideline and must be tailored to suit your specific implementation requirements. Please ensure thorough end-to-end testing is conducted to validate its functionality and performance in your environment.

Example 1: Model-Bound View

Model class: Promo.cs

View file: Promo.cshtml

Registering a component (an additional line in the ServiceCollectionExtensions class):

Example 2: View Component

The following view component additionally to the Image field received from layout response gets the data from third-party weather service and combine everything in the same model class.

Model classes:

View Component class:

View:

Registering a component (an additional line in the ServiceCollectionExtensions class):

Example 3: Partial view

To access the data that Experience Edge returns in a Razor view, you can add the following code to your Razor view: