Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. "This is an invalid webresource request."

"This is an invalid webresource request."

Scheduled Pinned Locked Moved ASP.NET
javascriptcsharpasp-netsysadminhardware
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    szukuro
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups