fixes MediaPickerService not found in canvas

[TFS Changeset #59260]
This commit is contained in:
starfighter83
2009-09-18 17:00:51 +00:00
parent 8ab14f370d
commit e34956d12f

View File

@@ -78,11 +78,18 @@ namespace umbraco.editorControls
ClientDependencyLoader.Instance.RegisterDependency("webservices/legacyAjaxCalls.asmx/js", "UmbracoRoot", ClientDependencyType.Javascript);
// And a reference to the media picker calls
ScriptManager sm = ScriptManager.GetCurrent(base.Page);
ServiceReference webservicePath = new ServiceReference(GlobalSettings.Path + "/webservices/MediaPickerService.asmx");
if (!UmbracoContext.Current.LiveEditingContext.Enabled)
{
ScriptManager sm = ScriptManager.GetCurrent(base.Page);
ServiceReference webservicePath = new ServiceReference(GlobalSettings.Path + "/webservices/MediaPickerService.asmx");
if (!sm.Services.Contains(webservicePath))
sm.Services.Add(webservicePath);
if (!sm.Services.Contains(webservicePath))
sm.Services.Add(webservicePath);
}
else
{
ClientDependencyLoader.Instance.RegisterDependency("webservices/MediaPickerService.asmx/js", "UmbracoRoot", ClientDependencyType.Javascript);
}
}
protected override void Render(System.Web.UI.HtmlTextWriter writer)