Hi, I had a problem running an embedded js file.
I tried all of the following:
- Starting the Cassini Development Server (VS2008, .NET 3.5)
- Added [assembly: WebResource ("MyNamespace.MyScriptFile.js", "text / javascript")] over the declaration of the class namespace.
- Script The file has an action of the "Embedded Resource" assembly.
- Trial registration during OnInit, OnLoad and OnPreRender
- The script file is in the same assembly and namespace as the control that registers it.
- The assembly with Reflector is open and the resource name is confirmed.
Doesn't work using one of the following methods:
ScriptManager.RegisterClientScriptResource(Page, GetType(), "MyNamespace.MyScriptFile.js");
Page.ClientScript.RegisterClientScriptResource(GetType(), "MyNamespace.MyScriptFile.js");
Page.ClientScript.RegisterClientScriptInclude(GetType(), "key",
Page.ClientScript.GetWebResourceUrl(GetType(), "MyNamespace.MyScriptFile.js"));
- Other WebResource.axd files are located - only this one was not found.
404 : "*[HttpException]: This is an invalid webresource request.*"
ScriptManager.RegisterClientScriptResource :
"*Web resource 'MyNamespace.MyScriptFile.js' was not found.*"