Custom module. Edit page doesn't save the changes

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
3/24/2012 2:40:14 PM
Gravatar
Total Posts 8

Custom module. Edit page doesn't save the changes

Hi. 

Now I'm creating my custom module. I do that following the training video "Building a Guestbook". I've created the Edit page and the buttons "Save" and "Delete" on it. The Delete button works but  the Save button doesn't. I.e. changes aren't saved.

Any ideas how to fix this?

Thanks

3/24/2012 2:51:35 PM
Gravatar
Total Posts 42

Re: Custom module. Edit page doesn't save the changes

Before the button cliick event there is Page_Load so maybe it clears data before you are able to save it?

Tomasz

3/26/2012 4:20:16 AM
Gravatar
Total Posts 8

Re: Custom module. Edit page doesn't save the changes

This is my Page_Load event:

protected void Page_Load(object sender, EventArgs e)
{
LoadParams();

if (!UserCanEditModule(moduleId, ItemGuid))
{
SiteUtils.RedirectToAccessDeniedPage(this);
return;
}

LoadSettings();
PopulateLabels();
PopulateControls();

}

It's the same as in the training video "Building a Guestbook".

3/26/2012 7:28:50 AM
Gravatar
Total Posts 42

Re: Custom module. Edit page doesn't save the changes

Try to add:

if (!IsPostback)

{

PopulateControls();

}

Tomasz

3/26/2012 7:33:24 AM
Gravatar
Total Posts 42

Re: Custom module. Edit page doesn't save the changes

It seems  that before you save the data you entered in the (f.ex. textbox) controls, the Page_Load loads the old values and you save them again instead of saving the new values.

Tomasz

3/28/2012 4:46:03 PM
Gravatar
Total Posts 8

Re: Custom module. Edit page doesn't save the changes

Tomasz, thank you for your attempt to help me.

Actually I hastened to say about the problem. Initially it also appears in the video too but it's solved later.

However, I have another problem but I'll say about it in other topic.

You must sign in to post in the forums. This thread is closed to new posts.