protected void Page_Load(object sender, EventArgs e) { ServicesFramework.Instance.RequestAjaxAntiForgerySupport(); try { // If logged in, inject Edit JavaScript, and delete / add items if (UserMayEditThisModule) { ClientScriptManager ClientScript = Page.ClientScript; // ToDo: Move these RegisterScripts to JS to prevent including AngularJS twice (from other modules) ClientResourceManager.RegisterScript(this.Page, "~/DesktopModules/ToSIC_SexyContent/Js/AngularJS/angular.min.js", 80); ClientResourceManager.RegisterScript(this.Page, "~/DesktopModules/ToSIC_SexyContent/Js/2sxc.TemplateSelector.js", 81); ClientResourceManager.RegisterScript(this.Page, "~/DesktopModules/ToSIC_SexyContent/Js/2sxc.ApiService.js", 82); ClientResourceManager.RegisterScript(this.Page, "~/DesktopModules/ToSIC_SexyContent/Js/ViewEdit.js", 82); ClientResourceManager.RegisterScript(this.Page, "~/DesktopModules/ToSIC_SexyContent/Js/2sxc.DnnActionMenuMapper.js", 83); var hasContent = AppId.HasValue && Template != null && Items.Any(p => p.EntityID.HasValue); var templateChooserVisible = Settings.ContainsKey(SexyContent.SettingsShowTemplateChooser) ? Boolean.Parse(Settings[SexyContent.SettingsShowTemplateChooser].ToString()) : !hasContent; ((DotNetNuke.UI.Modules.ModuleHost) this.Parent).Attributes.Add("data-2sxc", Newtonsoft.Json.JsonConvert.SerializeObject(new { moduleId = ModuleId, manage = new { isEditMode = UserMayEditThisModule, templateChooserVisible = templateChooserVisible, hasContent = hasContent, isContentApp = IsContentApp, appId = AppId, isList = AppId.HasValue && Items.Count > 1, templateId = Template != null ? Template.TemplateID : new int?(), contentTypeId = Template != null ? Template.AttributeSetID : 0, config = new { portalId = PortalId, tabId = TabId, moduleId = ModuleId, contentGroupId = AppId.HasValue ? Sexy.GetContentGroupIdFromModule(ModuleId) : 0, dialogUrl = DotNetNuke.Common.Globals.NavigateURL(this.TabId), returnUrl = Request.RawUrl, appPath = AppId.HasValue ? Sexy.App.Path : null, cultureDimension = AppId.HasValue ? Sexy.GetCurrentLanguageID() : new int?(), isList = Template != null && Template.UseForList } } })); ClientResourceManager.RegisterScript(this.Page, "~/DesktopModules/ToSIC_SexyContent/Js/2sxc.api.js", 90); ClientResourceManager.RegisterScript(this.Page, "~/DesktopModules/ToSIC_SexyContent/Js/2sxc.api.manage.js", 91); } } catch (Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } }