开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜