<%@ 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" />
<asp:ImageButton BorderColor="Black" BorderStyle="Solid" BorderWidth="1" runat="server"
id="button" ImageUrl="ColorPicker.gif" />
<obout:ColorPickerExtender runat="server" ID="picker" OnClientOpen="onClientOpen" PickButton="false"
OnColorPostBack="color_postback" AutoPostBack="true" TargetProperty="style.backgroundColor"
PopupButtonID="button" TargetControlID="textbox" />