Last post Aug 15, 2017 04:05 PM by GADOI2
Aug 14, 2017 08:07 PM|GADOI2|LINK
My objective is to have a web page call a dll which will return a string containing a table which will contain images (this is a general simplified description but accurate)
In the dll, I am embedding images (they are an embedded resource)
I am declaring them
I would like to do the following...
I have tried the following....
Dim path as string = cs.GetWebResourceUrl(Me.GetType(),
I am getting this error:
Event code: 3012
Event message: An error occurred processing a web or script resource request. The requested resource 'MyClass|first.gif' does not exist or there was a problem loading it.
Not sure what to do.
I am concerned this is not accurate:
because I do not think it needs a reference to the calling page - rather the calling page should just receive the payload..... but not sure.
Thank you for any suggestions.
Aug 15, 2017 09:07 AM|Eric Du|LINK
According to your description, as far as I know, this issue is related to the file or file path.
So you need check if exist the first.gif file? Also you need check if get the right path? This will better help you to solve the problem.
Aug 15, 2017 10:46 AM|mgebhard|LINK
Web site generally have an images folder and the images are directly referenced by path and file name. What you're doing is found in Windows applications where an assembly contains embedded images. This is not the best design for web application as you'll
need to embed the image (base-64 encode the images). This increases the image size by 1/3, removes the ability to cache, and in general causes a bunch of extra work.
This will not work...
The result needs to look like this...
<img alt="MyImage" src="data:image/png;base64,iVBORw0KGgoAAAANSUh... />
First you'll need to fetch the images https://msdn.microsoft.com/en-us/library/yf17tthe(v=vs.90).aspx, encode the image, then format the HTML. It is much easier to copy the image
to a folder within the web application and link to the images.
Aug 15, 2017 04:05 PM|GADOI2|LINK
I agree - less is more, at least here.
Thank you for helping me see through all these trees.