I have created a user control to act as a placeholder for a number of common dialogs and it works just as you would expect.
Except...
One of the windows needs a OnClientClose function and, each calling page is going to need to do something different. So, in my CommonDialogs control I have this ...
My calling code looks, called from the codebehind of the main page, looks like this ...
And this is the definition of the function in the markup of the main page ...
Now, if I have the definition of the GroupSubscription window on the main page and I have the OnClientClose function name in the <RadWindow> definition, everything works, but the set up described above when the GroupSubscription window closes, I get a JavaScript error ...
a[b] is not a function
http://localhost/v1.1/MyApplication/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-GB%3a0d787d5c-3903-4814-ad72-296cea810318%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.3.1208.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-GB%3a6ed19be3-4ef3-4060-9b74-4985886ad7d9%3a16e4e7cd%3aed16cbdc%3af7645509%3a86526ba7%3a874f8ea2%3a11a04f7e%3a24ee1bba%3ae330518b%3a1e771326%3ac8618e41%3a8e6f0d33%3a6a6d718d%3aa7e79140%3ae524c98b%3a4cacbc31%3ab7778d6c%3aaa288e2d%3a58366029%3a19620875%3a33108d14%3abd8f85e4%3a39040b5c%3af85f9819
Line 6
If anyone can shed any light on this, I'd be grateful.
--
Stuart
Except...
One of the windows needs a OnClientClose function and, each calling page is going to need to do something different. So, in my CommonDialogs control I have this ...
function OpenCommonGroupSubscription(OnClientClose) { |
var manager = $find("<%= wmCommonDialogs.ClientID %>"); |
var wnd = manager.getWindowById("<%= winGroupSubscription.ClientID %>"); |
if (OnClientClose != null && OnClientClose != "") { |
wnd.add_close(OnClientClose); |
} |
wnd.show(); |
return false; |
} |
My calling code looks, called from the codebehind of the main page, looks like this ...
LocalManager.ResponseScripts.Add("OpenCommonGroupSubscription('SubscribeToGroups_ClientClose');"); |
And this is the definition of the function in the markup of the main page ...
function SubscribeToGroups_ClientClose(sender, args) { |
setTimeout(function() { |
AjaxRequestWithTarget("<%= btnHiddenPostback.UniqueID %>", "SubscribeToGroups;"); |
}, 500); |
} |
Now, if I have the definition of the GroupSubscription window on the main page and I have the OnClientClose function name in the <RadWindow> definition, everything works, but the set up described above when the GroupSubscription window closes, I get a JavaScript error ...
a[b] is not a function
http://localhost/v1.1/MyApplication/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-GB%3a0d787d5c-3903-4814-ad72-296cea810318%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.3.1208.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-GB%3a6ed19be3-4ef3-4060-9b74-4985886ad7d9%3a16e4e7cd%3aed16cbdc%3af7645509%3a86526ba7%3a874f8ea2%3a11a04f7e%3a24ee1bba%3ae330518b%3a1e771326%3ac8618e41%3a8e6f0d33%3a6a6d718d%3aa7e79140%3ae524c98b%3a4cacbc31%3ab7778d6c%3aaa288e2d%3a58366029%3a19620875%3a33108d14%3abd8f85e4%3a39040b5c%3af85f9819
Line 6
If anyone can shed any light on this, I'd be grateful.
--
Stuart