Mr. Boy
Mr. Boy

Reputation: 63816

Render vs Write in System.Web.UI.HtmlTextWriter

I'm programatically creating a simple HTML file which is saved directly to disk. I was looking at this example: http://www.dotnetperls.com/htmltextwriter

I'm confused why he mixes HtmlTextWriter's Render and Write methods, and how I should choose between RenderBeginTag() and WriteBeginTag().

Are there are hard rules on what is right & wrong?

Upvotes: 3

Views: 1593

Answers (1)

U1199880
U1199880

Reputation: 905

Use the RenderBeginTag overload of the RenderBeginTag(HtmlTextWriterTag) method if the markup element is of a known type that is one of the HtmlTextWriterTag enumeration values.

Upvotes: -2

Related Questions