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" />

"I really appreciate the way you helped and moreover the help came in such an electrifying speed.. Cool. Keep up the good work !!"

Atanu
Rebaca Technologies Pvt. Ltd.

Random testimonial   All testimonials