Problem with Custom Web Control

  • Thread starter Thread starter Dexter
  • Start date Start date
D

Dexter

Hello all,
I'm building a web custom control, but i hava a problem.
In the Sub Render, i have a html code as output. All ok.

I have a other class that has a function that return a image object,
and i need to insert this image in my html of output, but it
don't has a path.

Protected Overrides Sub Render(ByVal output As System.Web.UI.HtmlTextWriter)
dim saida as string
saida = "<table>"
saida += "<img src="">" --> ???????? What i do here to show the returned
image of my Function.
saida += "</table>"
End Sub

Somebody can help me in this task?
Thanks

Dexter
 
Ok karl,
this i know to do, but now, is possible to compile the assembly with a .aspx
page?
I don't want to have to distribute a .dll and a .aspx page, i want to
distribute only
the assembly (.dll).
Is possible to compile the .aspx page in a assembly?

Thanks.


Dexter
 
You can't do that. An image is an individual request and thus takes the
entire stream..you can't mix text (html) with binary (image) data.

What you can do is:

saida += "<img
src=imageGenerator.aspx?imageId=WHATEVERINFORMATION_YOU_NEED_TO_BUILD_YOUR_I
MAGE>";

and move your function that returns an image to imageGenerator.aspx, saving
the image to the Response.OutputStream ...

karl
 
The only thing I can think of is to use an HttpHandler..not sure if it'll do
the trick though, can't say I know enough to give a good answer, but
hopefully that'll give you something to try out...

Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top