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

Commented Unassigned: MaskedEditValidator js script doesn't get combined in ToolkitScriptManager [27666]

$
0
0
Hi,

If you use a simple page with a ToolkitScriptManager and a few controls or extenders (not the MaskedEditValidator), on the client, you get a single call to:
CombineScriptsHandler.axd?_TSM_CombinedScripts_=True&v=ZGSx55...9pk_GU1&_TSM_Bundles_=&cdn=False

If you add the MaskedEditValidator, you still get a call to the CombineScriptsHandler.axd url, but you get an additional call to:
ScriptResource.axd?d=LjkaZ0Kd7_Skw...a0ljiA2&t=38a5038f

which contains code that is the MaskedEditValidator minimized script:
// (c) 2010 CodePlex Foundation
function MaskedEditSetMessage(n,t,i){n.errormessage=t;.....

Running with the ACT source code, I can see that the line that causes this behaviour is in PreRender in
\AjaxControlToolkit\Server\AjaxControlToolkit\MaskedEdit\MaskedEditValidator.cs
line 358:

if (this.EnableClientScript)
{
// register Script Resource at current page
ScriptManager.RegisterClientScriptResource(this, typeof(MaskedEditValidator), "MaskedEdit.MaskedEditValidator.js");


This is the only ACT controls that calls RegisterClientScriptResource !!!

I'm under the impression that this line added to the class should provide the same thing, albeit without the conditional "if (this.EnableClientScript)":
[ClientScriptResource("Sys.Extended.UI.MaskedEditBehavior", "MaskedEdit.MaskedEditValidator.js")]

RegisterClientScriptResource just doesn't seem to work well with the ScriptResourceManager (standard or ACT versions).

In short: RegisterClientScriptResource should not be called in MaskedEditValidator.cs as it generates additional http requests.

Comments: PS: I don't know if the bug is with the MaskedEditValidator that should NOT call RegisterClientScriptResource or if it's with the ScriptManager which should recognize the script has already been added and therefore not generate an extra http request for it.

Viewing all articles
Browse latest Browse all 4356

Trending Articles



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