Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Hello,
I try to create a DynamicContentPlugIn but I would like to do that in MVC. Here is where I have currently implemented:
[DynamicContentPlugIn(Url = "/DynamicContent/MyTestController/Index", DisplayName = "MyTest")]
public class MyTest : IDynamicContentBase
{
public string Bla { get; set; }
public string State
{
get { return string.Empty; }
set { }
}
private PropertyDataCollection _myProperties;
public PropertyDataCollection Properties { get { return _myProperties; } }
public MyTest()
{
_myProperties = new PropertyDataCollection();
}
}
I have create an Area "DynamicContent" into my project and register this area like this:
public class DynamicContentAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "DynamicContent";
}
}
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute("DynamicContent_default",
"DynamicContent/{controller}/{action}/{id}",
new { action = "Index", id = UrlParameter.Optional }
);
}
}
And finally create my controller:
public class MyTestController : Controller
{
public ActionResult Index()
{
return View();
}
}
But I always have this error message: The user control "/DynamicContent/MyTestController/Index" could not be loaded.
How can I fix it?
Regards,
Benjamin V.