Hi, Jon
I got the image to appear, but it did require 2 changes to match your
coding;
1] the .vb file had to be compiled into the dll to work, can't be in the
app_code folder
Have no idea how to solve issue with App_Code, but may be such approach can
be usefull for you:
1) Compile your images into a .dll with SomeClass.
2) Then use that SomeClass from the code inside App_Code.
= = = = = = = = = = = = = = = = = = = =
HandlerTestRes.cs
= = = = = = = = = = = = = = = = = = = =
using System.Web.UI;
[assembly: WebResource("img1.gif", "image/gif")]
namespace HandlerExample
{
public class SomeClass
{
}
}
= = = = = = = = = =
Command line
= = = = = = = = = =
csc /t:library /out:../Bin/HandlerTestRes.dll /res:img1.gif,img1.gif
HandlerTestRes.cs
= = = = = = = = = = = = = = = = = = = =
SomePage.aspx.cs
= = = = = = = = = = = = = = = = = = = =
using System;
using System.Web;
public partial class SomePage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
String img1 = String.Format("<img src={0}>",
Page.ClientScript.GetWebResourceUrl(typeof(Handler Example.SomeClass),
"img1.gif"));
Response.Write(img1);
}
}
2] the httphandlers had to be in the web.config file.
Are you writing the HttpHandler, or just an ASPX page? If ASPX (and you code
located in corresponding .aspx.vb file) then you don't need the httphandlers
section in web.config.
Is there a way to have the httphandlers added programatically to the
web.config file ?
Don't think so.
Regards,
Alex.