I've got 2 problems saving the modulesettings on my paragraph edit .ascx usercontrol for a custom module I'm creating.
I've created a simple example that shows my problem.
Problem 1:
In my HellowWorld_Edit.ascx I've got the following module settings and controls:
<dw:modulesettings id="ModuleSettings1" runat="server" modulesystemname="HelloWorld" value="myText,myTemplate"></dw:modulesettings> <input id="myText" class="std" runat="server" type="text" /> <dw:filemanager id="myTemplate" runat="Server" folder="/Templates/HelloWorld/" name="myTemplate" />
In the Page_Load of HelloWorld_Edit.ascc I've got the following:
Dynamicweb.Properties p = default(Dynamicweb.Properties):
Dynamicweb.Properties p = default(Dynamicweb.Properties); p = Dynamicweb.Properties.LoadProperties(); p.SetDefaultValue("myText", "Hello default text"); p.SetDefaultValue("myTemplate", "template.html"); myText.Value = p.Values["myText"].ToString(); myTemplate.Value = p.Values["myTemplate"].ToString();
When I create a new paragraph and attach the module I write something in the input field and choose a different template then "template.html".
The text I write in the input field isn't saved but the the template i choose is successfully saved.
When I take a look into the database I see the following in the "ParagraphModuleSettings" column for the paragraph:
<?xml version="1.0" encoding="utf-8"?><Settings><myText></myText><myTemplate>template_v2.html</myTemplate><myTemplate_path>/Files/Templates/HelloWorld/template_v2.html</myTemplate_path></Settings>
What am I doing wrong?
Problem 2:
Pretty simple: On my HelloWorld_Edit.ascx I wan't to create an asp:DropDown with some values from a database I created for my module. The problem is the same as above - the value isn't saved even though I specify the ID of the control in the ModuleSettings on my _Edit usercontrol.
Can't i use ASP.NET controls for ModuelSettings?
Any suggestions :-)