Developer forum

Forum » Development » Can't save FileManager control value...

Can't save FileManager control value...

Bjarne Rosendal
Reply

Hi guys

I have this code in an _edit.aspx page:

<dw:FileManager ID="MyList" Name="MyList" Folder="Templates\NewsV2\List" Extensions="htm,html,xsl,xslt" runat="server" />

I can't get this control to save it's value. Am I missing something or is the control obsulete?

Here's what happens when I try to save: http://screencast.com/t/fjPm0zjuNP

 


Replies

 
Mikkel Ricky
Reply

Have you added the control id to the dw:ModuleSettings element in your edit page? See the section Storing Module Related Data in Dynamicweb in Building Custom Modules for details.

Best regards,
Mikkel

 

 
Bjarne Rosendal
Reply

Hi Ricky

I didn't have it in the first place, but added it now. But same story when I try to save. I have included the .aspx now. Fairly simple as you can see.

 
Mikkel Ricky
Reply
This post has been marked as an answer

The section (in http://developer.dynamicweb.com/documentation/for-developers/dynamicweb-custom-modules/building-modules-series/7-steps-to-building-a-custom-module-hands-on.aspx)

When you edit the page with your custom module through the Navigation Panel again, you'll notice the content you added earlier again is gone. You see how to fix this in the next installment in this article series about building custom modules for Dynamicweb.

is very important – try reading that next installment.

Best regards,
Mikkel 

Votes for this answer: 1
 
Bjarne Rosendal
Reply

Thanks for clearing out, Ricky. Got it working now! :)

 
Thaw Htun Lynn
Reply

Hi, I still don't get the filemanager control value saved after saved.

I am having the issue though i did all the same as the documentation said. Any further suggestion?

 

 
Nicolai Høeg Pedersen
Reply

Huh?

What do you do? What do you get?

Can we see some code or get a bit of explanation?

 
Thaw Htun Lynn
Reply

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

 
Thaw Htun Lynn
Reply

well I now get it saved. I didn't quiet get the reason but I think it's because I fail to update the aspx file while I am testing. Anyway, I am really thankful that you are always there to help Mr.Nicolai. I really do.

 
Nicolai Høeg Pedersen
Reply

Hi Thaw

Glad you found it :-). Glad to help!

 

You must be logged in to post in the forum