ASP.NET 如何点击取消按钮 使得控件内的内容都消失掉 10
stringfilename=TextBox1.Text;stringsebj=DropDownList1.Text;stringfiltyp=DropDownList2...
string filename = TextBox1.Text; string sebj = DropDownList1.Text; string filtyp = DropDownList2.Text; string teach = DropDownList3.Text; string filadd = FileUpload1.FileName;
展开
1个回答
展开全部
没太明白你的意思,但是你给取消写一个事件,把里面的控件都赋成空值不就完了
前台:
<asp:Button ID="BtnReg" Text ="取消" runat="server" onclick="BtnReg_Click" />
后台
protected void BtnReg_Click(object sender, EventArgs e)
{
TextBox1.Text = "";
DropDownList1.Text = "";
DropDownList2.Text = "";
DropDownList3.Text = "";
FileUpload1.FileName = "";
}
前台:
<asp:Button ID="BtnReg" Text ="取消" runat="server" onclick="BtnReg_Click" />
后台
protected void BtnReg_Click(object sender, EventArgs e)
{
TextBox1.Text = "";
DropDownList1.Text = "";
DropDownList2.Text = "";
DropDownList3.Text = "";
FileUpload1.FileName = "";
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询