如何清除多个文本框
问题描述:
我可以通过编码清除多个文本框吗
如果它们很丰富
can i get the coding to clear multiple no of textboxes
if they are plentiful
答
获取表单中的控件类型,如果它们是文本框,请清除它们。
Get the type of controls in your form, and if they are textboxes, clear them.
foreach (TextBox txt in this.Controls.Find("textBox",true))
{
txt.Clear();
}
试试这个,
Try this,
<input style="cursor: hand; width:80px;" title="reset all fields" type="button" value="Reset" önclick="javascript:reset()" id="btReset" name="btReset" />
这将清除页面上的所有字段。无需计算多少。
This will clear all the fields on the page. No need to count how many.
textbox1.Text="";
textbox1.Text=null;