客户端事件:
Code:
<script language="javascript" type="text/javascript">
function ClearAllTextBox() {
var obj = window.document.forms[0];
for (i = 0; i < obj.elements.length; i++) {
var elem = obj.elements[i];
if (elem) {
if (elem.type == "text") {
elem.value = "";
}
}
}
}
</script>
服务器端事件:
Code:
foreach (Control c in this.FindControl("form1").Controls)
{
if (c is TextBox)
{
((TextBox)c).Text = "";
}
}