using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class Default2 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { string[] arr = { "1", "2", "3", "4", "5" }; for (int i = 0; i < arr.Length; i++) { TextBox2.Text += arr[i].ToString(); } } protected void TextBox2_TextChanged(object sender, EventArgs e) { } }
拖一个TextBox控件,然后输入Page Load里面的内容就可以了。
<%for (int i = 0; i < arry.Length; i++)
{%>
<%=arry[i]%>
<% }%>
Response.Write(string.Join("", array));
Response.End();
<%for (int i = 0; i < arry.Length; i++)
{%>
<%=arry[i]%>
<% }%>
.NET WEBFORM 就是<% 这些写着太麻烦了
直接在网页上写<%=string.Join(",", array)%>