473,396 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Accessing embedded resource in subfolder?

for some reason i can't access a resource (.js) if the control files and the
resource are in a subfolder off the project root or just the resource is in a
subfolder.

the code is as follows ( this is an example with the resourse in a
sub-folder called Resources):

private void RegisterScript(Control targetControl) {
String pageScriptName = "Cbs.Ui.Controls.Resources.ControlScript";
if ( !this.Page.IsClientScriptBlockRegistered(pageScrip tName) ) {
using (System.IO.StreamReader reader = new
System.IO.StreamReader(typeof(Cbs.Ui.Controls.Firs tFocus).Assembly.GetManifestResourceStream(typeof( Cbs.Ui.Controls.FirstFocus),
"Cbs.Ui.Controls.Resources.ControlScript.js")) ) {
String script = "<script language='javascript' type='text/javascript'
\r\n<!--\r\n" + reader.ReadToEnd() + "\r\n//-->\r\n</script>";

this.Page.RegisterClientScriptBlock(pageScriptName , script);
}
}

the code failes on the using line with the error:
Value cannot be null. Parameter name: stream

Everything works fine if its all in the root and refer to the script as just
"ControlScript.js"

I understand that the fully qualified name of a resource in a sub-folder
should be <namespace>.<subfolder>.<resourcename>.<extension> .

Am i missing something?

Thanks,
Christian
Nov 18 '05 #1
0 1568

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Philipp Seidel | last post by:
Hi there! I did not know, where this topic fits in, so I put it here. I have a minor problem with embedded resources, which puzzles me quite a lot. I'd be glad if anyone can help me on this: ...
1
by: james | last post by:
What class / method should I be using to get the full path to an embedded resource ? In my case I have an .xml file that my app uses, it is set as embedded resource, and I have a control that...
1
by: Sreekanth | last post by:
Hi, I am trying to globalize my application by separating out all the strings into resource files. For testing purpose, I have created two resource files. MyApp.resx, MyApp.en-US.resx. These resx...
3
by: C-Services Holland b.v. | last post by:
Hi all, I've created a custom button which I can stick into my toolbox. This all works well and I see my button in the designer. This button uses customised graphics and I want to stick it in...
0
by: Aleksey Tkachenko | last post by:
Hi All, How to compile the assembly dll to make the embedded resources ( icons ) accessible by ID number? I have one icon compiled with "embedded resource" option, but when I open the dll by VS...
4
by: roger31 | last post by:
Hello - i have created a simple composite control with drop down list displaying the US States. I have also a Javascript (County.js) file embedded inside the control. The Javascript file has an...
0
by: Matthew Brealey | last post by:
I have the following entry in a .skin file: <asp:button runat=server SkinId=btnSubmit ImageUrl="~/Images/ submit.gif" /> But I want to make the image an embedded resource in a different...
0
by: schneider | last post by:
Hi all, I created a User Control "SlideShow.ascx" in my application's root. Then I created a subfolder and an aspx page "MySlideShow1.aspx" in there. I added an instance of the ascx control to...
4
by: moondaddy | last post by:
I have a user control located in the following path: projectFolder/PropertyControls/myControl.xaml and in myControl.xaml I have a reference to a resource dictionary like this: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.