Pergunta

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.

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top