开发者

ASP.NET Webforms write output html for control

I want to create my own hierarchical navigation menu control without using standart ASP.NET controls. So, I want to control my html output and I found out that I can override Render method to write html into respose. Is it good place for this? Where in control creating lifecycle I should prepare data for my control?

protected override void Render(HtmlTextWriter writer)
{
    ba开发者_如何转开发se.Render(writer);
    Response.Write("<b>hello</b>");
}


It is exactly the Render method that is the correct place to do this. But don't write it to the Response, write it to the provided as argument HtmlTextWriter instead.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜