Render Control in httpHandler
How can I render a control (TreeView to be specific) in httpHandler? I have tried the following:
var p = new Panel();
p.Controls.Add(plcLinks);
p.Controls.Add(htmlTreeView);
var sw = new StringWriter();
var writer = new HtmlTextWriter(sw);
page.RenderControl(writer);
context.Response.Write(sw.ToString());
The result was a simple bulleted list not a tree view control as I accepted.开发者_StackOverflow How can I get a tree view control as a result in mine page?
do it like this:
var p = new Panel();
p.Controls.Add(plcLinks);
p.Controls.Add(htmlTreeView);
p.RenderControl(new HtmlTextWriter(context.Response.Output));
It was just a change in the css file
精彩评论