Posted on 01/07/2016 05:15:27
this is in frontend cs
public override string GetContent()
{
Dynamicweb.Rendering.Template template = new
Dynamicweb.Rendering.Template("MyModule/" +
Properties.Values["SelectTemplate"].ToString());
template.SetTag("Text", Properties.Values["HelloText"].ToString());
template.SetTag("guessWhat", "Boom!");
return template.Output();
}
and here is part of edit.aspx
<dw:ModuleSettings id="ModuleSettings1" runat="server" ModuleSystemName="HelloWorld" Value="HelloText,SelectTemplate" />
<dw:GroupBox ID="GroupBox1" runat="server" Title="Text">
<table style="width: 100%;">
<tr>
<td style="width:170px;">Text</td>
<td><input id="HelloText" class="std" type="text" runat="server"/></td>
<td><dw:FileManager ID="SelectTemplate" Folder="Templates/MyModule"
runat="server" /></td>
</tr>
</table>
</dw:GroupBox>
and page load function
protected void Page_Load(object sender, EventArgs e)
{
Properties properties = Dynamicweb.Properties.LoadProperties();
properties.SetDefaultValue("SelectTemplate", "Template.html");
properties.SetDefaultValue("HelloText", "Hi Dynamicweb!");
HelloText.Value = properties.Values["HelloText"].ToString();
SelectTemplate.File = properties.Values["SelectTemplate"].ToString();
}
plus template
<p>@GetString("Text")</p>
<p>@GetString("guessWhat")</p>
I got nothing coz the template is reset to empty whenever i save and close in module setting