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 trouble getting the following to work in SQL Server 2k, but it
Having trouble getting this to work. What's strange is that I have 10 bookmarks
I'm having trouble getting the following three-column layout to work: A B C +-------+-------------------+------------+
Having trouble getting the following code to work: $('#changeMode').button().click(function(){ $('#playfield').toggle(function() { $(this).switchClass(gridView,plainView); }, function()
I having trouble getting a variable assignment to work in the following initializer: -
I am having trouble getting MvcSiteMapProvider to work. I have read the documentation on
I'm having trouble getting the CanExecute method of my command to work property. I've
I'm having trouble getting the server to recognize a JSON POST request since I
I am having trouble getting my application to work correctly. I am trying to
having trouble getting my directx going I get the following error 1>Linking... 1>main.obj :

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.