From c72ab927a66925ee7aa8e8d0c3255a4ced1cafad Mon Sep 17 00:00:00 2001 From: "funka@WETWIRED" Date: Wed, 17 Oct 2012 05:36:22 +0700 Subject: [PATCH] Resolves redundant BaseTreePicker script initialization (U4-192) --- src/umbraco.controls/TreePicker/BaseTreePicker.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/umbraco.controls/TreePicker/BaseTreePicker.cs b/src/umbraco.controls/TreePicker/BaseTreePicker.cs index d2eecf7f03..1f200a32cc 100644 --- a/src/umbraco.controls/TreePicker/BaseTreePicker.cs +++ b/src/umbraco.controls/TreePicker/BaseTreePicker.cs @@ -141,13 +141,14 @@ namespace umbraco.uicontrols.TreePicker /// protected virtual void RenderJSComponents() { + const string scriptKey = "BaseTreePickerScripts"; if (ScriptManager.GetCurrent(Page).IsInAsyncPostBack) { - ScriptManager.RegisterStartupScript(this, this.GetType(), this.GetType().ToString(), BaseTreePickerScripts.BaseTreePicker, true); + ScriptManager.RegisterStartupScript(this, this.GetType(), scriptKey, BaseTreePickerScripts.BaseTreePicker, true); } else { - Page.ClientScript.RegisterClientScriptBlock(typeof(BaseTreePicker), this.GetType().ToString(), BaseTreePickerScripts.BaseTreePicker, true); + Page.ClientScript.RegisterClientScriptBlock(typeof(BaseTreePicker), scriptKey, BaseTreePickerScripts.BaseTreePicker, true); } }