我在 asp.net c# 中需要帮助.....我想在运行时编辑动态创建的标签,并希望在每次回发时都保留在那里....任何人都可以帮助 plzzz...
protected void btnLabel_Click(object sender, EventArgs e)
{
int count = 1;
if (ViewState["label"] != null)
{
count += Convert.ToInt32(ViewState["label"]);
}
Label lbl = new Label();
lbl.ID = "ttl" + count.ToString();
lbl.Text = "Editable label";
Panel1.Controls.Add(lbl);
ViewState["label"] = count;
}