Question

I have a handler to get all image urls and other data from a mysql table in the ashx handler, but now i want to do a webcontrol (e.g: Panel.Controls.Add(new LiteralControl("<div>Example</div>"));) and send it to the page, to be displayed.

How can i do that if it is possible.

Was it helpful?

Solution

It is not possible to render server controls from a generic handler, however, you could return plain HTML and use javascript / jquery to display the returned HTML.

You can also build a server control structure, render it to a stringwriter and return the generated markup

See the answer here Use ASP.Net server control code generation from .ashx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top