ASP.NET 3.5 and above only

Obout.Ajax.UI Controls - Color Picker - TextBox with ColorPickerExtender

Click to the TextBox to select background color:

Color PickerClose the picker
ASP.NET
<%@ Register Assembly="Obout.Ajax.UI" Namespace="Obout.Ajax.UI.ColorPicker" TagPrefix="obout" %>
<script runat="server" language="c#">
protected void color_postback(object sender, Obout.Ajax.UI.ColorPicker.ColorPostBackEventArgs e)
{
  textbox.Style[HtmlTextWriterStyle.BackgroundColor] = e.Color;
}
</script>
...
<script type="text/JavaScript"> function onClientOpen(sender, args) {
   sender.setColor(sender.get_targetElement().style.backgroundColor);
}
</script>
...
<asp:TextBox runat="server" Text="" id="textbox" ReadOnly="true"
    style="cursor: pointer; background-color: #FFFFFF" />
<obout:ColorPickerExtender runat="server" ID="picker" OnClientOpen="onClientOpen"
    OnColorPostBack="color_postback" AutoPostBack="true" TargetProperty="style.backgroundColor"
    PopupButtonID="textbox" TargetControlID="textbox" />

"Please accept our heart felt thanks for the wonderful set of controls."

Vishal Agarwal
Spatial Ideas

Random testimonial   All testimonials