ASP.NET-内联与代码隐藏 [英] ASP.NET - Inline vs. Code-Behind
本文介绍了ASP.NET-内联与代码隐藏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我意识到,通过提出这个问题,我本可以开始启示录的,但是我的一位同事在其aspx页面中使用了很多内联编码,而我更喜欢使用后面的代码.
I realize that by asking this question, I could have started the apocalypse, but a colleague of mine uses a lot of inline coding in their aspx pages, where as I prefer using the code-behind.
这里有对与错的方法吗?
Is there a right and a wrong way here?
推荐答案
除非您的编码标准另有说明,否则不要.
Not unless your coding standard says otherwise.
隐藏IMO代码有助于分离问题,所以我更喜欢这样做,但有时只处理一个文件也是一件好事.
IMO code-behind helps separation of concerns, so I prefer that, but sometimes just dealing with one file is nice too.
这篇关于ASP.NET-内联与代码隐藏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文