"This is an invalid webresource request."
ASP.NET
1
Posts
1
Posters
0
Views
1
Watching
-
I have an ASP.NET custom control in a class library, which (apart from server-side logic) has client-side functionality. As far is I know this is best achieved by adding the javascript file to the project as an embedded resource and registering it via code, like this:
string scriptLocation = Page.ClientScript.GetWebResourceUrl(this.GetType(), "Namespace.Control.js"); Page.ClientScript.RegisterClientScriptInclude("Namespace.Control.js", scriptLocation);
Now the funny thing is, it works as expected on one site, however if used on a page in a second site that uses the same class library, I get the following Exception: "This is an invalid webresource request.". Google only came up with solutions for cases, where it doesn't work at all. Right now I have absolutely no idea what could cause this different behavior for the 2 sites. Any comment on the subject would be appreciated.