Web Forms 是三种创建 ASP.NET 网站和 Web 应用程序的编程模式中的一种。
其他两种编程模式是 Web Pages 和 MVC(Model View Controller 模型-视图-控制器)。
Web Forms 是最古老的 ASP.NET 编程模式,是整合了 HTML、服务器控件和服务器代码的事件驱动网页。
Web Forms 是在服务器上编译和执行的,再由服务器生成 HTML 显示为网页。
Web Forms - 事件 语法
事件句柄是一种针对给定事件来执行代码的子例程。
Web Forms - 事件 示例
<%lbl1.Text="The date and time is " & now()%> <html> <body> <form runat="server"> <h3><asp:label id="lbl1" runat="server" /></h3> </form> </body> </html>