I am working on a Custom Composite ASP.net Server Control.
It requires to call up images, and I´ve added said images as an embedded resource. However, doing so I can only get the image as a bitmap file, and i need to pass the file to an Image Control, which only takes ImageURL, or string path. How can I reference the file sin my resources? Supossing i have images called "image1.gif" in my resources if i code:
Resources.image1
I get the object as an image, but i don't know how to get a path, so that i can give it directly to my Image component.
Thanks in advance!
EDIt:
string[] alarmArrayString = new string[5]; Through a for loop I am assigning the appropriate values. I checked it during debugging and all 5 placeholders had an appropriate value.
These are being populated correctly, it seems the problem is with the Page.ClientScript, or the getting Type.
For example:
orangeAlarm = new Image();
orangeAlarm.ID = "orangeAlarmObject";
orangeAlarm.ImageUrl = Page.ClientScript.GetWebResourceUrl(this.GetType(), alarmArrayString[1]);
I separated the Page.ClientScript and this.GetType as:
ClientScriptManager cs = Page.ClientScript; Type rsType = this.GetType();
And I get the exception error on both of those...
Extra:
AssemblyInfo.cs sample: [assembly: System.Web.UI.WebResource("RDCButtonTest.Resources.401.gif","image/gif")] [assembly: System.Web.UI.WebResource("RDCButtonTest.Resources.410.gif","image/gif")] [assembly: System.Web.UI.WebResource("RDCButtonTest.Resources.411.gif","image/gif")]