Webresource script not embedded? not working.

Z

zb

I have my code directory structured this way
App
App\Pages <- contains ASPX files
App\Pages\Common
App\Pages\Common\Controls <- has user controls
App\Pages\Common\Controls\SupportingJS <- has .js script files located
here

THe .js file is marked as embedded resource in VS.

Rootname space of the application is: name.space.code.end

How would I embed this as a resource in the build?
I have referred other publishes on the internet but to no help. The
directory structure is very straight forward.

In assembly.cs file this is what I added:
[assembly:
WebResource("name.space.code.end.SupportingJS.clientcode.ascx.js",
"text/javascript")]
OR
[assembly:
WebResource("name.space.code.end.pages.common.controls.SupportingJS.clientcode.ascx.js",
"text/javascript")]

Neither seem to help.
In user control, i have this code:
this.Page.ClientScript.RegisterClientScriptInclude(this.GetType(),
"name.space.code.end.SupportingJS.clientcode",
this.Page.ClientScript.GetWebResourceUrl(this.GetType(),
"name.space.code.end.SupportingJS.clientcode.ascx.js"));

And similar combination for the other webresource registration as
shown above.
All combinations have failed? An example will be very helpful.

I read on the Internet the format of this should be: [Assembly of this
project].[Folder containing resource].[Filename of resource]. But, the
examples I see are simple 1 or 2 deep directory structures. How would
this apply in my case (as shown above)?

Thanks.
 
I

IfThenElse

possibly it could be taking the namespace as
[name.space.code.end.pages.common.controls.SupportingJS.clientcode] ???
and it thinks that your file name is [ascx.js]

[assembly: System.Web.UI.WebResource("myImage.gif", "img/gif")]
[assembly: System.Web.UI.WebResource("myStylesheet.css", "text/css")]
[assembly: System.Web.UI.WebResource("myJavascript.js", "text/js")]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,782
Latest member
ThomasGex

Latest Threads

Top