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