Hi,
It does not matter if the <img......> tag is manually coded into the
HTML part of the page or if it is a control that finally outputs the
tag. All you have to do is to set the src to the page(NOT CONTROL!!!)
that will generate the image. It must be a page,not a control, because
the page is used in the src part of the img tag. Besides, you may want
to set the mime type of the response generated by the page. A control
can't do that because it must be a part of a page (text/html).
So you have to follow 2 steps:
1. Build a page that renders the image. I will call this page
chartgenerator.aspx. This page can take some parameters in a "GET"
request, parameters used to get the chart data. Now, if you access
http://localhost/myapp/chartgenerator.aspx?param1=val1¶m2=val2 the
output should be a image (JPG,GIF,etc). NO HTML. Just the image. This
is possible if you set the mimetype of the page properly and
Response.WriteBinary(...) the byte array of the image (see prev.
post). I really don't remember now the name of the property for the
mimetype thing. I only know that it is a property of the
System.Web.UI.Page (the base class of your chartgenerator.aspx)
2 a. Add a <img src="chartgenerator.aspx?param1=val1¶m2=val2" ....>
to your page containing the chart
OR
2.b Build a control that can generate the tag described at 2.a. With
this method, you can generate the "?param1=val1¶m2&val2" of the
link from the control's custom properties. It will be than available at
design time too
Bottom line...
1. You need a page able to generate an image from the parameters
received in a GET request
2. Any dinamically or hardcoded way of building the src attribute of
the img tag
3. Any dinamically or hardcoded way of printing the img tag itself
(along with the generated src) in the final HTML response
Hope it helps...