大家看看原文吧:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vstchWorkingWithSingle-FileWebFormsPagesInVisualStudio.asp?frame=trueTwo Models for Web Forms Pages There are two models for Web Forms pages: code-behind and single-file. Code-behind uses a programming model in which the layout HTML is contained in the .aspx file, and the code for the page is contained in a separate class file. In the single-file model, the UI elements and code are in the same file.Single-file Web Forms pages are functionally very similar to pages that have a separate code file. For example, you use the same controls on both types of pages. Users still request pages using the same .aspx extension for the file name, and the page still is run using server-side code that streams HTML to the client. 注意里面的Code Behind和Single File的区别
xx.aspx.cs中能访问的控件只能是RunAtServer的控件,也就是Web Control或者Html Control上加Runat=Server的那些控件。
说一个是客户端,一个是服务器端太牵强了,归分为界面设计和后台代码设计可能更加恰当一点,诸位以为如何?对于WEB FORM的理解,我实在不太明白bigliang兄的意思。
小弟以为Web Form只不过是用来进行数据录入的一种表现形式,具体处理还是靠ado.net来进行的。而没有Web Form,数据处理也是可以的。web form就只是web form,没有什么数据和代码分开的概念,更加不是.net才提出来的,早在html时代就有了web form.希望大家不要在这里误导别人。
1。他在服务器上提供了基于事件的编程模式,类似vb中。
2。允许HTML标记和应用程序逻辑分开,可以让性能提高!
3。他提供了丰富的设计时体验。vs.net提供了快速应用程序开发功能/(RAD)。
There are two models for Web Forms pages: code-behind and single-file. Code-behind uses a programming model in which the layout HTML is contained in the .aspx file, and the code for the page is contained in a separate class file. In the single-file model, the UI elements and code are in the same file.Single-file Web Forms pages are functionally very similar to pages that have a separate code file. For example, you use the same controls on both types of pages. Users still request pages using the same .aspx extension for the file name, and the page still is run using server-side code that streams HTML to the client.
注意里面的Code Behind和Single File的区别