heyne230
asked on
How to clear all the controls of an aspx page(form)?
How to clear all the controls of an aspx page
My page has combo boxes , text boxes , radio buttons etc
Client side:
i tried
document.forms[0].reset();
Did not work as its supposed to only for html pages
Server side:
this.form1.Controls.Clear( );
the above statement gave me an error. y?
What is the solution using client side javascripting?
AND also if we have to do this from server side?
My page has combo boxes , text boxes , radio buttons etc
Client side:
i tried
document.forms[0].reset();
Did not work as its supposed to only for html pages
Server side:
this.form1.Controls.Clear(
the above statement gave me an error. y?
What is the solution using client side javascripting?
AND also if we have to do this from server side?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
Please check link:
http://niitdeveloper.blogspot.com/2010/08/take-control-of-controls-in-aspnet-page.html
Regards,
VSS
Please check link:
http://niitdeveloper.blogspot.com/2010/08/take-control-of-controls-in-aspnet-page.html
Regards,
VSS
You could do it from the code behind and iterate recursively and find all the controls that are the same type and also reset.
Are you wanting to reset on a js action, or when the form posts and you want it to be cleared?