Skip to main content

MVCxImageSliderItem.SetTemplateContent(String) Method

Allows you to provide a template for rendering the image slider item’s content.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v23.2.dll

NuGet Package: DevExpress.Web.Mvc5

Declaration

public void SetTemplateContent(
    string content
)

Parameters

Name Type Description
content String

A string value specifying the template content.

Remarks

The code sample below demonstrates how to use the SetTemplateContent method to define the item’s content.

View code:

@Html.DevExpress().ImageSlider(
    settings =>
    {
        settings.Name = "myImageSlider";
        settings.ShowNavigationBar = false;
        ...
        settings.Items.Add(item =>
        {
            item.SetTemplateContent("<img src=\"Content/blueberry.jpg\" style=\"width:390px;padding:5px;\" /><p style=\"color:yellow;margin:10px;\">My Custom Text</p>");
        });
    }
).GetHtml()

The image below demonstrates the result.

MVCImageSliderItem_SetTemplateContent

See Also