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.
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.