Good practice writing HTML with StringBuilder in my ASP.NET Codebehind code?

I am interested to hear from other developers my opinion on the approach that I usually take. I have a web application, asp.net 2.0, C #.

What I usually do to write drop-down lists, tables, input controls, etc., is in the code using StringBuilder and writing something like sb.Append ("

I do not use many .net controls as I usually write html in code. When I want to use jQuery or call JavaScript, I simply put this function call in my sb.Append tag, for example sb.Append ("td ... onblur = 'fnCallJS ()".

I really liked this approach. To access the data, I use EntitySpaces.

I'm just curious if this approach is terrible, well, depending on context, good, time to learn 3.0, etc. I am interested in learning and just looking for some input.


Edit

After reading the comments here, it sounds like I should take a look at MVC. I haven't done it yet. The only indecision in this is that the existing project is only the existing one. There is a lot of code already done as I explained, and it's hard to imagine what would be associated with changing it, the benefits of it, and just knowing what it would do.

, , , sb.Append, . , , , , , , x, y z.

div .aspx, .innerHtml StringBuilder .

. , .

+3
8

html .

, , -. , asp.net mvc.

- , html , . . , . ( ), . , , .

/ , aspx. . , html- , . .

+2

, HTML- , HTML-, , . VS IDE - HTML-. .

+1

, , , "" ASP (vbScript) PHP.

- " ASP", Webforms , , , . , , WebForm.

ASP.net WebForms vs MCV, , . MVC - - , , " ASP" PHP backgound.

, WebForms, , , , , , . , , , , , , , .

+1

, , ... " . , , , / ? , .

0

, HtmlTextWriter .

, , aspx .

0

, ASP.Net MVC. , ASP.Net HTML, CSS, JavaScript .. - , ASP.Net MVC ( , , - , , ASP.Net ).

, , , ( ), StringWriter. StringBuilder , , .Net- (, Write vs. Append).

0

, , - ( ).

0

, , , , "" () , , .

#, StringBuilder html JavaScript. , , , / front-end? , , .aspx .

, /. . , Javascript. . .

0

Source: https://habr.com/ru/post/1738431/


All Articles