I used the following JS / C # to clean the form.
C # to add onload js call
Page.ClientScript.RegisterStartupScript(typeof(WebForm3), "ClearPage", "ClearForm();", true);
Js to clean form
function ClearForm() {
var AllControls = document.getElementById('ctl00_ContentPlaceHolder1_PnlAll')
var Inputs = AllControls.getElementsByTagName('input');
for (var y = 0; y < Inputs.length; y++) {
type = Inputs[y].type
switch (type) {
case "text":
case "textarea":
case "password":
Inputs[y].value = "";
break;
}
}
}
source
share