0

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)
{
    base.Render(writer);
    Response.Write("<b>hello</b>");
}

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.