November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
What happens if you remove IDynamicContentView? I did something similar a while a go and I couldn't have both the render method and the ViewUrl as one canceled out the other.
Ah yes you're righ! When i removed that interface i was able to render the view. Now just to figure out how to render the xform object from the model which is a dynamic content :)
any luck with this one?
wheni delete IDynamicContentView it complains it not compatible with MVC
But when it is included it wont go to my view ".cshtml" and onyl runs Render
I'm trying to make an XForm dynamic content in EPiServer 7 MVC but I can't really get it to work.
At the moment I've created a class which looks like this:
[DynamicContentPlugIn(DisplayName = "XForms", ViewUrl = "~/Views/Shared/DynamicContent/XFormView.cshtml")]
public class XForms : DynamicContentBase, IDynamicContentView
{
public XForms()
{
Properties = new PropertyDataCollection {{"XFormControl", new PropertyXForm()}};
}
public virtual void Render(TextWriter writer)
{
writer.Write("<div>Hello world</div>");
}
}
With this i was hoping that the file specified in the ViewUrl property would be rendered but all that will render is the "Hello world" in the Render method. Can someone give me some guidance on how I can load this view or give tips on how to load an xform control in the render method?