can .cs contain html code? no.cs is called code-behind file, by separating your server code into a .cs, you separate presentation from logic. The benefits are:1. you can change them separately, so a designer can change the html and an engineer can change the c# code independently
2. .cs file is compiled into a dll and people cannot see your source code (although it is possible to decompile the dll into source code unless you use an obfuscator to make it harder to do so)
3. you can reuse your c# code in other places
2. .cs file is compiled into a dll and people cannot see your source code (although it is possible to decompile the dll into source code unless you use an obfuscator to make it harder to do so)
3. you can reuse your c# code in other places
ASPX中:是展示所有外观效果的地方
如果东西放在一起,当你对你的程序进行维护的时候,特别是只是修改一下html代码的时候,会发现那是多么让人抓狂,简简单单得页面,集中代码累加起却要好几页
支持以上观点~