This project is read-only.

Driver always posting for admin

Topics: Customizing Orchard
Jul 13, 2014 at 6:05 PM
We've add 2 parts to the admin screens to the "Site" admin screen and they appear correctly under the Settings menu along with: Users, Cache etc. Initially they appear to work correctly.

Then we added a notifier message and some other code and found that all the sub items are all posting all the time. This means that our parts post and then display the notifier message even if not selected on screen. Example of our code below. Although rather simple below we have code in the true block to validate other settings so that's the reason that this is a problem as we don't want it updating all the time.

Have we setup the driver incorrectly or do we need to filter in some way?
   if (updater.TryUpdateModel(part, Prefix, null, null)) {
                _notifier.Information(T("My Module settings have been successfully updated."));
            else {
                _notifier.Error(T("Error during My module settings save!"));
Jul 13, 2014 at 9:36 PM
That's because for site settings drivers you have to use a bit different pattern, see this driver: