002. 在HTML页面嵌入循环代码

 1 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
 2 
 3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 4 
 5 <html xmlns="http://www.w3.org/1999/xhtml">
 6 <head runat="server">
 7      <title>HTML服务器控件</title>
 8     
 9 </head>
10 <body>
11     <form id="form1" runat="server">
12     <div>
13     <%for (int i = 1;i < 7;i++) %>
14     <%{%>
15     <font size=<%= i+1%>>Hello World!</font></br>
16     <%}%>
17 
18     </div>
19     </form>
20 </body>
21 </html>
原文地址:https://www.cnblogs.com/wxylog/p/6030580.html