Breaking News

Wednesday, December 30, 2009

Javascript: How to create ASP.NET Reset Button?

Wondering, how to create an ASP.NET based reset button; which is not an Html Reset(input type=reset)?

Type-in the following Javascript code into any ASP.NET control(Button, ImageButton, Link, etc) that exposes OnClientClick public property:

this.form.reset(); return false;

But why would I need this when there already is an Html based reset button available?

Sometimes you need this when you have a theme/skin applied over the page(that is, controls/buttons/textboxes/etc), and you want a button to be consistent with the site theme.

Note that you can append just about any Javascript code/function to objects and controls which then call straight up that Javascript function.

1 comment:

  1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Front end developer learn from Javascript Training in Chennai . or Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry. JavaScript Training in Chennai


Designed By Published.. Blogger Templates