Update: This issue can be closed since it's more of an upgrade question than an issue. I've posted the same question on the forum at http://forums.asp.net/t/2064615.aspx?Where+is+ScriptObjectBuilder+
Hello,
I am attempting to update AJAX Control Toolkit from v3 to v15. I have some legacy code that relies on ScriptObjectBuilder. More specifically, the code calls ScriptObjectBuilder.GetScriptReferences.
```
IEnumerable<ScriptReference> IScriptControl.GetScriptReferences()
{
foreach (ScriptReference modalReference in ScriptObjectBuilder.GetScriptReferences(typeof(ModalPopupExtender)))
yield return modalReference;
// Yields other script references
}
```
How should I update this code to work with v15?
Thank you
Comments: ScriptObjectBuilder was removed in v15.1. Unfortunately, there is no public API that can be used to get script references at the moment. We are considering implementing this API with a future release. You can try the following workaround for now: 1) Add the __AjaxControlToolkit.config__ file to your project root folder. 2) Write these lines to __AjaxControlToolkit.config__: <?xml version="1.0" encoding="utf-8" ?> <ajaxControlToolkit> <controlBundles> <controlBundle name="_CalendarScripts_"> <control name="CalendarExtender"></control> </controlBundle> </controlBundles> </ajaxControlToolkit> 3) Install the AjaxControlToolkit.StaticResources NuGet package: https://www.nuget.org/packages/AjaxControlToolkit.StaticResources/ 4) You can obtain the scripts required for CalendarExtender this way: ToolkitResourceManager.GetScriptPaths("_CalendarScripts_"); Note that "CalendarScripts" is the name of the bundle described in AjaxControlToolkit.config. If you need scripts for other controls, simply add corresponding <control name="..." /> lines.
Hello,
I am attempting to update AJAX Control Toolkit from v3 to v15. I have some legacy code that relies on ScriptObjectBuilder. More specifically, the code calls ScriptObjectBuilder.GetScriptReferences.
```
IEnumerable<ScriptReference> IScriptControl.GetScriptReferences()
{
foreach (ScriptReference modalReference in ScriptObjectBuilder.GetScriptReferences(typeof(ModalPopupExtender)))
yield return modalReference;
// Yields other script references
}
```
How should I update this code to work with v15?
Thank you
Comments: ScriptObjectBuilder was removed in v15.1. Unfortunately, there is no public API that can be used to get script references at the moment. We are considering implementing this API with a future release. You can try the following workaround for now: 1) Add the __AjaxControlToolkit.config__ file to your project root folder. 2) Write these lines to __AjaxControlToolkit.config__: <?xml version="1.0" encoding="utf-8" ?> <ajaxControlToolkit> <controlBundles> <controlBundle name="_CalendarScripts_"> <control name="CalendarExtender"></control> </controlBundle> </controlBundles> </ajaxControlToolkit> 3) Install the AjaxControlToolkit.StaticResources NuGet package: https://www.nuget.org/packages/AjaxControlToolkit.StaticResources/ 4) You can obtain the scripts required for CalendarExtender this way: ToolkitResourceManager.GetScriptPaths("_CalendarScripts_"); Note that "CalendarScripts" is the name of the bundle described in AjaxControlToolkit.config. If you need scripts for other controls, simply add corresponding <control name="..." /> lines.