A
Andrew Jocelyn
Hi
I have a web control which can be visible=false on page load. When I do a
postback with in an UpdatePanel (EnablePartialRendering=true) I get the
following error.
Microsoft JScript runtime error: Sys.ScriptLoadFailedException: The script
'DisplayLengthFunctions.js' failed to load. Check for:
Inaccessible path.
Script errors. (IE) Enable 'Display a notification about every script
error' under advanced settings.
Missing call to Sys.Application.notifyScriptLoaded().
The control has a OnPreRender event as follows:
protected override void OnPreRender(EventArgs e)
{
ScriptManager.RegisterClientScriptInclude(
this,
this.GetType(),
"DisplayLengthFunctions",
ResolveClientUrl("~/DisplayLengthFunctions.js"));
ScriptManager.RegisterStartupScript(this, this.GetType(),
string.Format("{0}_DisplayLength", this.UniqueID),
string.Format("DisplayCounter('{0}','{1}_Counter',{2});", _textBox.ClientID,
this.UniqueID, this.MaxLength), true);
}
If I put the above in the OnLoad event I get the same error. If the control
is visible=true on on initial page load then postback works as expected.
What do I need to do to allow the control to work after a postback makes it
visible?
Thanks
Andrew
I have a web control which can be visible=false on page load. When I do a
postback with in an UpdatePanel (EnablePartialRendering=true) I get the
following error.
Microsoft JScript runtime error: Sys.ScriptLoadFailedException: The script
'DisplayLengthFunctions.js' failed to load. Check for:
Inaccessible path.
Script errors. (IE) Enable 'Display a notification about every script
error' under advanced settings.
Missing call to Sys.Application.notifyScriptLoaded().
The control has a OnPreRender event as follows:
protected override void OnPreRender(EventArgs e)
{
ScriptManager.RegisterClientScriptInclude(
this,
this.GetType(),
"DisplayLengthFunctions",
ResolveClientUrl("~/DisplayLengthFunctions.js"));
ScriptManager.RegisterStartupScript(this, this.GetType(),
string.Format("{0}_DisplayLength", this.UniqueID),
string.Format("DisplayCounter('{0}','{1}_Counter',{2});", _textBox.ClientID,
this.UniqueID, this.MaxLength), true);
}
If I put the above in the OnLoad event I get the same error. If the control
is visible=true on on initial page load then postback works as expected.
What do I need to do to allow the control to work after a postback makes it
visible?
Thanks
Andrew