473,796 Members | 2,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Control s.Resources.Con trolScript";
if ( !this.Page.IsCl ientScriptBlock Registered(page ScriptName) ) {
using (System.IO.Stre amReader reader = new
System.IO.Strea mReader(typeof( Cbs.Ui.Controls .FirstFocus).As sembly.GetManif estResourceStre am(typeof(Cbs.U i.Controls.Firs tFocus),
"Cbs.Ui.Control s.Resources.Con trolScript.js") )) {
String script = "<script language='javas cript' type='text/javascript'
\r\n<!--\r\n" + reader.ReadToEn d() + "\r\n//-->\r\n</script>";

this.Page.Regis terClientScript Block(pageScrip tName, 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>.<su bfolder>.<resou rcename>.<exten sion>.

Am i missing something?

Thanks,
Christian
Nov 18 '05 #1
0 1584

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

Similar topics

0
761
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: I've added a few files (images) to an assembly as embedded resources. Within the project folder these files are in a subfolder named "images".
1
24180
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 needs to load it, but I do not want to hard code the path since that may change for different installs. i.e. GetPathForResourceOfName ( myResourceFileName ) thanks, JIM
1
2069
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 files are built into binary resource files(.resources) and embedded into MyApp.exe by my make script. The problem, Even after setting my machine culture to English -United states, my application is always picking from the nuetral resource file....
3
2013
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 the dll as an embedded resource. In the project tree I added a folder in which I stick the bitmaps (png's actually) and set he compile option for them to EmbeddedResource. But how do I access them from my (vb)source? The docs say:
0
928
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 6.0 resource editor I see only the version resource with ID number 1. I can add another icon there by this editor, but how to make it using usual VS 2005 solution? So, how can I assign the IDs numbers to resources and make them accessible by VS...
4
1836
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 array of County Names. IN another Javascript i have a function that will display a list of county names for the selected state. I am using the following to register the javascript rstype = resource type; rsname = fully qualified resource name...
0
1189
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 assembly, using WebResource.axd. How can I do this?
0
5801
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 this page. Now here's my question: How can I access the aspx page's resource (e.g. App_LocalResources/MySlideShow1.aspx.resx) from within the instance of the ascx control? The code that wants to access the resource is located in the ascx control...
4
17943
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: <UserControl.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary
0
9685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9531
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10237
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10187
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10018
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9055
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.