ThemeableButton
You have to create a simple class that derived from Button
. Then override the OnClientClick
property and add a Themeable
attribute to as follows.
[ToolboxData("<{0}:Button runat=\"server\" />")]
public class ThemeableButton : Button
{
[Themeable(true)]
public override string OnClientClick
{
get { return base.OnClientClick; }
set { base.OnClientClick = value; }
}
}
Web.Config
Now, you have to replace the old button with new one. Change the pages
section as follows.
<pages>
<tagMapping>
<add tagType="System.Web.UI.WebControls.Button, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
mappedTagType="[Namespace].ThemeableButton, [AssemblyName]" />
</tagMapping>
</pages>