Click here to Skip to main content
11,478,066 members (71,822 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Embedded resource
I have two projects:
1) MyProject1
2) MyProject2

Directory Structure
MyProject1
-Images
---BaseControl
------img1.gif
------img2.gif
------img3.gif
-Css
---BaseControl
------StyleSheet.css
-Controls
---BaseControl.cs - derived from CompositeControl
---Derived1.cs - derived from BaseControl
---Derived11.cs - derived from BaseControl
---Derived12.cs - derived from BaseControl


MyProject2
-Controls
---Derived4.cs - derived from BaseControl



Assembly.cs for MyProject1
NOTE: Image is set as an embedded resource

[assembly: WebResource("MyProjects1.Images.BaseControl.gif", "img/gif")]
To get the link to the WebResource, I do the following:

myImgControl.ImageUrl = this.GetImageUrl("MyProject1.Images.BaseControl.gif");



This works fine with Derived1, Derived11 and Derived12 controls since the embedded resource is available to their parent. However, Derived4 control cannot find the images because the 'MyProject1.Images.BaseControl.gif' is not part of its embedded resource.

Let me know if you need anymore info.
Thanks.
Posted 12-Aug-10 4:35am
Fayu1.8K
Comments
E.F. Nijboer at 12-Aug-10 9:59am
   
Is there a question hidden somewhere?
Walt Fair, Jr. at 3-Dec-10 22:03pm
   
Is there a reason why not to add the images or BaseControl to Project2?
Fayu at 5-Dec-10 23:04pm
   
Project1 is the main redistributed assembly. Project2 is a different assembly, which contains external developers implementation of BaseControl.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 219
1 F-ES Sitecore 170
2 Sascha Lefèvre 170
3 Frankie-C 110
4 OriginalGriff 95
0 Sergey Alexandrovich Kryukov 7,675
1 OriginalGriff 7,321
2 Sascha Lefèvre 3,034
3 Maciej Los 2,491
4 Richard Deeming 2,325


Advertise | Privacy | Mobile
Web04 | 2.8.150520.1 | Last Updated 12 Aug 2010
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100