Marked a javascript file as "Embedded resource"
Added WebResource attribute to my AssemblyInfo class
Now i'm trying to output the embedded javascript to my master page. All I'm getting is a "Web Resource not found" from the web resource url.
Project Assembly Name:
CompanyProduct
Project Default Namespace:
Company.Product.Web
Javascript file located:
Library/navigation.js
AssemblyInfo:
[assembly: WebResource("CompanyProduct.Library.navigation.js", "text/javascript")]
Code in master page:
Page.ClientScript.RegisterClientScriptInclude("NavigationScript", Page.ClientScript.GetWebResourceUrl(this.GetType(), "CompanyProduct.Library.navigation.js"));
Instead of this.GetType()
, get a type from the assembly that contains the resource.. ie:
typeof(Company.Product.Web.Library.Class1)
Does that work?