62,041
社区成员
发帖
与我相关
我的任务
分享
protected void Button1_Click(object sender, EventArgs e)
{
HttpCookie mycook = Request.Cookies["my"];
int j=Convert.ToInt32(mycook.Value);
int k=j+1;
mycook.Value = k.ToString();
Response.Cookies.Add(mycook);
HtmlTable tb = (HtmlTable)DetailsView1.Rows[10].FindControl("tb");
int i = Convert.ToInt32(mycook.Value);
if (i < 5)
{
FileUpload f = new FileUpload();
f.Enabled = true;
tb.Rows[i].Cells[0].Controls.Add(f);
}
else
{
Response.Write("<script>alert('最多只能添加5个附件!')</script>");
}
}