Your code is writing HTML. But it's writing it to your StringWriter
, which is not what you had in mind.
Try writing it to Response.Output
instead.
FYI, you would do better taking that sort of code out of Page_Load and using a User Control instead.