Developer forum

Forum » Development » Error Saving ModuleSettings on database

Error Saving ModuleSettings on database

Diogo Lino
Reply
Hello,

I'm trying to create an _Edit file with a FileManager to choose a template.
<dw:FileManager ID="FrontEndTemplate" runat="server" folder="/Templates/CustomModuleXPTO/" />

On the top I have the control on the settings list:
<dw:ModuleSettings id="ModuleSettings1" runat="server" ModuleSystemName="CustomModuleXPTO" Value="FrontEndTemplate" />

It is loading correctly by using this code:
        protected void Page_Load(object sender, EventArgs e)
        {
            Properties properties = Properties.LoadProperties();

            if (properties.Values["FrontEndTemplate"] != null)
            {
                FrontEndTemplate.Value = properties.Values["FrontEndTemplate"].ToString();
            }
        }

The problem is when I save the changes. It stores an error page on the database. It stores the content of the page here attached with the title "The state information is invalid for this page and might be corrupted".
It seems like there was a "ViewStateException: Invalid viewstate"...

Did this happened with anybody else?

Thanks,
Diogo Lino
 

 


Capture.PNG

Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi Diogo,
 

Which version of Dynamicweb is this running on? And is the Edit file an ASPX page or an ASCX User Control?

Two things you can try, although I don't think they should matter:

1. Add a name attribute to the FileManager and set its value to FrontEndTemplate
2. Remove the leading slash (/) on the folder attribute.

Cheers,

Imar

 
Diogo Lino
Reply
This post has been marked as an answer
Hi,

The problem was simply solved. A dummy error: I had an HTML <form> element inside the _Edit page.

Thanks anyway!

Diogo

Votes for this answer: 0

 

You must be logged in to post in the forum