AI OnAI Off
Apparently the exception was thrown because I hadn't added any properties to the class.
When I added, for example,
public string MyProperty { get; set; }
there was no error.
Seems weird that you have to have at least one property to get the dynamic content to work properly...
Now this is an interesting feature. What if I don't need any properties...?
Hi,
I'm trying to create a very simple dynamiccontentplugin but when I've added it to the page and click on the publish button I get an error:
"Index was outside the bounds of the array."
Stack trace:
[IndexOutOfRangeException: Index was outside the bounds of the array.]
EPiServer.DynamicContent.DynamicContentBase.set_State(String value) +341
EPiServer.DynamicContent.DynamicContentFactory.CreateDynamicContent(String name, String state, String hash, Boolean validateHash) +62
EPiServer.Core.Html.StringParsing.DynamicContentFragment..ctor(IDynamicContentFactory factory, ISecuredFragmentMarkupGenerator securedFragmentMarkupGenerator, String dynamicClass, String state, String hash, Boolean evaluateHash) +82
EPiServer.Core.Html.StringParsing.FragmentParser.ExtractDynamicContentFromElement(HtmlFragmentData fragmentData, ElementFragment element) +371
EPiServer.Core.Html.StringParsing.FragmentParser.TryToExtractDynamicContent(HtmlFragmentData fragmentData, ElementFragment element) +147
EPiServer.Core.Html.StringParsing.FragmentParser.ParseElement(HtmlFragmentData fragmentData, ElementFragment element) +31
EPiServer.Core.Html.StringParsing.FragmentParser.ProcessFragments(HtmlFragmentData fragmentData, Boolean returnOnEndElement) +318
EPiServer.Core.Html.StringParsing.FragmentParser.Parse(String html, FragmentParserMode parserMode, Boolean evaluateHash) +194
EPiServer.UI.Editor.Dialogs.DynamicContentPreview.CreateDynamicContentPreview(String textContents) +49
EPiServer.UI.Editor.Dialogs.DynamicContentPreview.OnInit(EventArgs e) +302
System.Web.UI.Control.InitRecursive(Control namingContainer) +143
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1477
Any ideas on how to resolve this? This feature should work out of the box without any problems.