Render vs Write in System.Web.UI.HtmlTextWriter

I am programmatically creating a simple HTML file that is saved directly to disk. I looked at this example: http://www.dotnetperls.com/htmltextwriter

I am confused why he mixes the methods HtmlTextWriter

Render

and Write

, and how should I choose between RenderBeginTag()

and WriteBeginTag()

.

Are there hard and fast rules as to what is right and wrong?

+3


source to share


1 answer


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



-2


source







All Articles