<script runat=“server”> vs. code-behind file
-
22-07-2019 - |
Question
Are there any caching/performance/significant differences between c# code placed in <script runat='server'></script>
as oppose in the code-behind?
Solution
No, no performance difference, in the end this is always compiled to an assembly anyway.
OTHER TIPS
No, it gets compiled to the same thing.
I suggest you use the code-behind file, in order to separate logic and markup.
The number one significant difference to me is readability.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow