In a UserControl; if I want to include a property that is defined on, let say, the start page, and that should be possible to edit in DOPE, I do the following...
.ascx
.ascx.cs
public PageData root;
public EPiServer.WebControls.Property Whatever;
private void Page_Load(object sender, System.EventArgs e)
{
root = Global.EPDataFactory.GetPage(Global.EPConfig.StartPage);
Whatever.InnerProperty = root.Property["Whatever"];
Whatever.Editable = true;
}
But it feels like I'm missing out on something really basic.
Sorry for wasting yours and everyone elses time. I was probably drivelling you away with this too-simple-to-be-a-saying-what-he-says question (because I don't see how your prop would work). It should of course just be;
.ascx
Duh, take that back. DOPE changes doesn't stick, alltough it looks like they save at first glance. But when I reload page, it's reset.
Anyone? I feel like a real DOPE here...
public PageData root; public EPiServer.WebControls.Property Whatever; private void Page_Load(object sender, System.EventArgs e) { root = Global.EPDataFactory.GetPage(Global.EPConfig.StartPage); Whatever.InnerProperty = root.Property["Whatever"]; Whatever.Editable = true; }
But it feels like I'm missing out on something really basic.