Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 427447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:34:43+00:00 2026-05-12T19:34:43+00:00

Hi I am having trouble getting an embedded js file to work. I have

  • 0

Hi I am having trouble getting an embedded js file to work.

I have tried all of the following:

  • Running Cassini development server (VS2008, .NET 3.5)
  • Added [assembly: WebResource(“MyNamespace.MyScriptFile.js”, “text/javascript”)] above the class’s namespace declaration.
  • Script file has build action “Embedded Resource”.
  • Tried registering during OnInit, OnLoad and OnPreRender
  • Script file is in the same assembly and namespace as the control registering it.
  • Opened assembly with Reflector and verified the name of the resource is correct.
  • Does not work using any 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 being found – only this one is not being found.

The request for the resource returns a 404 page with an exception listed: "*[HttpException]: This is an invalid webresource request.*"

Using the ScriptManager.RegisterClientScriptResource produces the exception:

"*Web resource 'MyNamespace.MyScriptFile.js' was not found.*"
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T19:34:43+00:00Added an answer on May 12, 2026 at 7:34 pm

    Try implementing your own ScriptManger and then adding the embedded file from there. Here’s an example

    public class MyScriptManager : System.Web.UI.ScriptManager
    {
        protected override void OnInit(EventArgs e)
        {
                base.OnInit(e);
                RegisterClientScriptResource(this, typeof(ScriptManagerExtension), "MyNamespace.MyScriptFile.js");
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a little trouble getting localized resources files to work on Windows Phone
Having trouble getting one portion of my code to work. Building a rudimentary linked
Having trouble getting a simple validation to work in Rails 3, even though the
Im having trouble getting some html 5 code to work on the android. It
I am having trouble getting this to work. I would like to trigger the
Having trouble getting my form to UPDATE records in my database even after searching
Im having trouble getting my head around the concept of the factory design pattern.
I'm having trouble getting something to compile. I don't understand the error thrown out
Hey guys, I'm having trouble understanding a Rails construct. I'm using Rails 3 but
Currently, if I want to get a certain collection of products, for example best-selling,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.