asp.netでコントロールから出力されるhtmlを得る方法

' targetControl = CreateOutputControls()

Dim sw = New System.IO.StringWriter
Dim htw As New HtmlTextWriter(sw)
targetControl.RenderControl(htw)
htw .Flush()

Literal1.Text = sw.ToString()