Vulnerability in EPiServer.Forms

Try our conversational search powered by Generative AI!

New blocks show message "The 'block' can not be displayed"


I'm learning EPiServer 7.5, and have created a couple of blocks for an image slider.  We're doing this in MVC.  I've added a ContentArea to a view, and am able to successfully drag blocks to the view and also to use the "create a new block" link that appears in the content area.  However, after adding one or more blocks, the area where each block would appear displays a message like the following:

"The 'SlideBlock' can not be displayed"

This message persists whether I publish the changes or not.  Upon selecting the properties icon for any of these blocks, I see the following menu options:

  • Edit
  • Personalize
  • Move Up
  • Move Down
  • Remove

But I don't see the "Display As" menu option with it's submenu of choices.  That may be where my problem stems.

This is my SlideBlock view.

@using EPiServer.Core
@using EPiServer.Web.Mvc.Html
@model EPiServerExercise.Models.Blocks.SlideBlock
<>div class="psSlide @Html.PropertyFor(m => m.CssClass)">
    @if (!String.IsNullOrEmpty(Model.ImageLinkUrl))
        <>a href="@Html.PropertyFor(m => m.ImageLinkUrl)">
    @if (!String.IsNullOrEmpty(Model.ImageSrc))
        <>img src="@Html.PropertyFor(m => m.ImageSrc)"
             alt="@Html.PropertyFor(m => m.ImageAlt)"
             title="@Html.PropertyFor(m => m.ImageTitle)"
             border="0" />
    @if (!String.IsNullOrEmpty(Model.ImageLinkUrl))

And this is my SlideBlock model.

using System;
using System.ComponentModel.DataAnnotations;
using EPiServer.Core;
using EPiServer.DataAbstraction;
using EPiServer.DataAnnotations;
namespace EPiServerExercise.Models.Blocks
        DisplayName = "Slide Block",
        GUID = "7c144e24-ca47-42a7-ba5b-86f3f1c38e5a",
        Description = "Block for child slides rendered in the Slider Block."
    public class SlideBlock : BlockData
            Name = "Image Link URL",
            Description = "URL where browser will be directed when image is clicked.",
            Prompt = "Image click target URL",
            GroupName = SystemTabNames.Content,
            Order = 10)]
        public virtual string ImageLinkUrl { getset; }
            Name = "Image Src",
            Description = "Src attribute for image tag.",
            Prompt = "Where image resides",
            GroupName = SystemTabNames.Content,
            Order = 20)]
        public virtual string ImageSrc { getset; }
            Name = "Image Alt",
            Description = "Alt attribute for image tag.",
            Prompt = "Alt attribute for image",
            GroupName = SystemTabNames.Content,
            Order = 30)]
        public virtual string ImageAlt { getset; }
            Name = "Image Title",
            Description = "Title attribute for image tag.",
            Prompt = "Title attribute for image",
            GroupName = SystemTabNames.Content,
            Order = 40)]
        public virtual string ImageTitle { getset; }
            Name = "CSS Class",
            Description = "Additional CSS class for the slide container div. This gets appended to .psSlide class.",
            Prompt = "",
            GroupName = SystemTabNames.Content,
            Order = 50)]
        public virtual string CssClass { getset; }

What do I need to change to make these blocks appear?  Thanks for your help.

Nov 26, 2014 18:33

Hi! In what path do you have your block view? If you don't have a custom view engine the standard location should be ~/Views/Shared/SlideBlock.cshtml.

Nov 27, 2014 9:11

Thanks Mattias. That was the solution.  I had the view in a different directory.

Dec 01, 2014 14:55

No problem Ken. If you want to use a different directory you can have your own ViewEngine:

public class MyViewEngine : RazorViewEngine
    public MyViewEngine()
        PartialViewLocationFormats = PartialViewLocationFormats.Union(new[]

Register it in Application_Start in Global.asax.cs:

ViewEngines.Engines.Insert(0, new MyViewEngine());
Dec 02, 2014 8:24

Thanks Mattias, that will come in useful.

Dec 02, 2014 17:34
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.