Asp.net inline versus codebehind that you use and why?

I did this in both directions, and to be honest, in addition to being able to pass code and a web form to two different people (which does not happen when I work), I see very few advantages of one method over Others. I can understand how good it is to have code in one file and markup in another, but I can also understand how easy it is to have both in one file.

I don’t see how using code makes you use any “good” programming, because you can still write crappy code in the code, and I saw some really clean things with a string.

So my real questions, what method are you using? and is there anything you can do programmatically with code that simply cannot be executed with inline code? or it all really comes down to the simple question of "personal preference." Microsoft does not seem to maintain a real position anyway, and the performance is wise, it seems that washing.

opinions?

+3
source share
5 answers

Personal preferences

Of course. With a big pinch of "noise tolerance level."

Jeff , . , , , (, Jeff, VB XML ).

, , HTML (, HTML ).

?... .

0

, , , .

, , , .

.

, , , , "".

, .

2c.

+2

, HTML . HTML ( , ... ..), . .

+2

, .:) , . # .aspx, (, ), ClientID JavaScript ..

, . , ;) , . , - . , , - . . !:)

If you use small scripts strictly related to the layout, follow it.

0
source

PLEASE - whatever you do, put your code in a separate file! I would not want to debug your code otherwise.

One of the problems with the previous asp was that everything was on one page, which after many changes in the code became unmanageable.

Please do us a favor and use one of the great .NET features and a separate html from the server side code.

Thanks...

:)

0
source

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


All Articles