@namespace Oqtane.Modules.HtmlText @inherits ModuleBase @inject ISettingService SettingService @implements Oqtane.Interfaces.ISettingsControl @inject IStringLocalizer Localizer @inject IStringLocalizer SharedLocalizer Allow File Management: @SharedLocalizer["Yes"] @SharedLocalizer["No"] @code { private string resourceType = "Oqtane.Modules.HtmlText.Settings, Oqtane.Client"; // for localization private string _allowfilemanagement; protected override void OnInitialized() { try { _allowfilemanagement = SettingService.GetSetting(ModuleState.Settings, "AllowFileManagement", "true"); } catch (Exception ex) { ModuleInstance.AddModuleMessage(ex.Message, MessageType.Error); } } public async Task UpdateSettings() { try { var settings = await SettingService.GetModuleSettingsAsync(ModuleState.ModuleId); settings = SettingService.SetSetting(settings, "AllowFileManagement", _allowfilemanagement); await SettingService.UpdateModuleSettingsAsync(settings, ModuleState.ModuleId); } catch (Exception ex) { ModuleInstance.AddModuleMessage(ex.Message, MessageType.Error); } } }