@namespace YourCompany.Module.HelloWorld @inherits ModuleBase @inject ISettingService SettingService
@if (UserSecurity.IsAuthorized(PageState.User, "Edit", ModuleState.Permissions)) {
}
@if (!string.IsNullOrEmpty(url2)) {
}

@code { string url1 = ""; // use https://www.oqtane.org/Portals/0/Images/helloworld.png string url2 = ""; protected override async Task OnInitializedAsync() { Dictionary settings = await SettingService.GetModuleSettingsAsync(ModuleState.ModuleId); url2 = SettingService.GetSetting(settings, "url", ""); } private async Task Save() { if (!string.IsNullOrEmpty(url1)) { Dictionary settings = await SettingService.GetModuleSettingsAsync(ModuleState.ModuleId); SettingService.SetSetting(settings, "url", url1); await SettingService.UpdateModuleSettingsAsync(settings, ModuleState.ModuleId); ModuleInstance.AddModuleMessage("Url Saved", MessageType.Success); url2 = url1; StateHasChanged(); } else { ModuleInstance.AddModuleMessage("You Must Enter A Url", MessageType.Warning); } } }