Is it a Good Practice to Write HTML Using a StringBuilder in my ASP.NET Codebehind?

Posted by d3020 on Stack Overflow See other posts from Stack Overflow or by d3020
Published on 2010-03-25T03:22:41Z Indexed on 2010/03/25 3:33 UTC
Read the original article Hit count: 518

Filed under:
|
|

I'm interested to hear from other developers their opinion on an approach that I typically take. I have a web application, asp.net 2.0, c#.

What I usually do to write out drop downs, tables, input controls, etc. is in the code behind use StringBuilder and write out something like sb.Append("

I don't find myself using to many .net controls as I typically write out the html in the code behind. When I want to use jQuery or call JavaScript I just put that function call in my sb.Append tag like sb.Append("td...onblur='fnCallJS()'.

I've gotten pretty comfortable with this approach. For data access I use EntitySpaces.

I'm just kind of curious if this sort of approach is horribly wrong, ok depending on the context, good, time to learn 3.0, etc. I'm interested in learning and was just looking for some input.

© Stack Overflow or respective owner

Related posts about stringbuilder

Related posts about c#