Quantcast
Channel: AjaxControlToolkit Work Item Rss Feed
Viewing all articles
Browse latest Browse all 4356

Commented Unassigned: Exception when registering a custom control in bundles [27483]

$
0
0
After upgrading to the last version, and upgrading my project to handle control bundles as said in the blog post [July 2013 Release of the Ajax Control Toolkit](http://stephenwalther.com/archive/2013/07/25/july-2013-release-of-the-ajax-control-toolkit) I found no way to work again my project. It complies but when executed the only thing I saw is an exception of "Could not load control _Control Name_ . The script reference(s) of this control was not loaded correctly. If AjaxControlToolkit.config is used, probably this control is not registered properly."

After some hours of debugging and failure tries, the suspect which comes in my mind was about the Control Type registration and resolution, so I went deep in the AjaxControlToolkit code, and I saw that it's impossible to resolve from a bundle a control which has a __namespace__ which doesn't start with __assembly name__, a classic example where Assembly Name and assembly Root Namespace are different. So the code in place is at: __AjaxControlToolkit.ToolkitScriptManagerConfig__ __ln159__

For my urgent needs, I modified the type resolution from
```
ToolkitScriptManagerHelper.GetAssembly(control.Assembly)
.GetType(control.Assembly + "." + control.Name));
```

to
```
ToolkitScriptManagerHelper.GetAssembly(control.Assembly)
.GetType(control.Name));
```

This is just a temporary hack, but I think should be possible to load a control with namespace different from assembly name. It's clear I registered controls in the form of __name="Control full namespace"__ __assembly="Assembly name"__
Thanks
Comments: errors in "markdown"

Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>