简体   繁体   English

<script runat=“server”> vs. code-behind file

[英]<script runat=“server”> vs. code-behind file

与后面的代码相反,放置在<script runat='server'></script> c#代码之间在缓存/性能/显着差异方面是否存在?

不,没有性能上的差异,最后总会被编译成程序集。

No, it gets compiled to the same thing. 不,它被编译为同一件事。

I suggest you use the code-behind file, in order to separate logic and markup. 我建议您使用代码隐藏文件,以分隔逻辑和标记。

对我来说,最重要的区别是可读性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM