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

Commented Unassigned: Wrong css resource loaded when use inherit class of some ajax control [27821]

$
0
0
Hi,

I need to custom ComboBox control, so i create a class that inherit this control. But i can't use this class because the css resource is loaded is not correct.
Seem that ajaxToolkit use GetWebResourceUrl(control.GetType() ...) that return wrong resource if control.GetType() return wrong project type.

I have work around by adding a ComboBox control to my Controls then remove it.
Do you have any idea to get correct css resource for inherit class of some ajax toolkit control

Thanks
Comments: Hi Mikkhail, I saw this code in AjaxControlToolkit.ToolkitResourceManager class that used to get the resource link: ``` internal static string GetStyleHref(string name, Control control) { var minified = !IsDebuggingEnabled(); var controlType = control.GetType(); if(IsCdnEnabled()) return FormatStyleVirtualPath(name, minified).Replace("~/", Constants.CdnPrefix); return AjaxControlToolkitConfigSection.Current.UseStaticResources ? FormatStyleVirtualPath(name, minified) : control.Page.ClientScript.GetWebResourceUrl(controlType, FormatStyleResourceName(name, minified)); } ``` So with this implementation, if I inherit a control from a standard control of ACT for example (i.e like hanhtam83 did) public class TestComboBox: ComboBox {} The input type will be TestComboBox, and the assembly used to load resource will be the Assembly contain TestComBoBox class, so of course, in that assembly there is not resource of standard ComboBox, after that a wrong resource link will be pushed to client and exception will be thrown in Chrome.

Viewing all articles
Browse latest Browse all 4356

Trending Articles



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