开发者

Render Control in httpHandler

开发者 https://www.devze.com 2023-04-11 11:46 出处:网络
How can I render a control (TreeView to be specific) in httpHandler? I have tried the following: var p = new Panel();

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

精彩评论

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