protected override void OnInit(EventArgs e) { base.OnInit(e); cmdUpdate.Click += cmdUpdate_Click; cmdCancel.Click += cmdCancel_Click; _providerId = Convert.ToInt32(Request.Params["ProviderId"]); var provider = ExtensionUrlProviderController.GetModuleProviders(ModuleContext.PortalId) .SingleOrDefault(p => p.ProviderConfig.ExtensionUrlProviderId == _providerId); if (provider != null) { var settingsControlSrc = provider.ProviderConfig.SettingsControlSrc; var settingsControl = Page.LoadControl(settingsControlSrc); providerSettingsPlaceHolder.Controls.Add(settingsControl); // ReSharper disable SuspiciousTypeConversion.Global _providerSettingsControl = settingsControl as IExtensionUrlProviderSettingsControl; // ReSharper restore SuspiciousTypeConversion.Global if (_providerSettingsControl != null) { _providerSettingsControl.Provider = provider.ProviderConfig; } } }
protected override void OnInit(EventArgs e) { base.OnInit(e); this.cmdUpdate.Click += this.cmdUpdate_Click; this.cmdCancel.Click += this.cmdCancel_Click; this._providerId = Convert.ToInt32(this.Request.Params["ProviderId"]); var provider = ExtensionUrlProviderController.GetModuleProviders(this.ModuleContext.PortalId) .SingleOrDefault(p => p.ProviderConfig.ExtensionUrlProviderId == this._providerId); if (provider != null) { var settingsControlSrc = provider.ProviderConfig.SettingsControlSrc; var settingsControl = this.Page.LoadControl(settingsControlSrc); this.providerSettingsPlaceHolder.Controls.Add(settingsControl); // ReSharper disable SuspiciousTypeConversion.Global this._providerSettingsControl = settingsControl as IExtensionUrlProviderSettingsControl; // ReSharper restore SuspiciousTypeConversion.Global if (this._providerSettingsControl != null) { this._providerSettingsControl.Provider = provider.ProviderConfig; } } }