我在按钮单击事件中有此代码。问题是我想在每次文本框得到验证和提交时显示文本“线程已成功添加”,并希望在提交后清除该标签。有没有办法做到这一点?
protected void BtnThread_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
LabelThread.ForeColor = System.Drawing.Color.Purple;
LabelThread.Text = "Thread has been added successfully";
}
else
{
LabelThread.Text = "Thread couldnot not be added";
}
Thread obj = new Thread();
obj.Insert_thread = TxtBoxThread.Text;
int j = obj.insertmethod();
TxtBoxThread.Text = "";