$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
ColorEditor Server Side Event in ASP.NET
Home > How to > Color Editor Server Event

Unlike the multiple client side events that will fire when apply ColorEditor of KT.UI for ASP.NET, PerColorEditor control raises a single server side event - that is ColorChanged event, which can happen when users change the SelectedColor by using mouse or having mouse wheel. Users can use both ASP.NET codes and C#.NET programming codes to control this server side event.
We are going to arrange this ColorEditor server side event tutorial in following three aspects:
  • First part mainly describes what the ColorChanged server side event is
  • Second party offers the detailed sample ASPX codes and complete C# demo codes on setting ColorEditor ColorChanged server side event
  • Then, last part displays the recommended guides for ColorEditor client side event

What Is ColorChanged Server Side Event

ColorChanged server side event of ColorEditor will fire when the user changes the SelectedColor with the mouse or mouse wheel. Users are able to set the AutoPostBack property as True to fire the event right after the color is changed on the client and retrieve the SelectedColor property within the ColorChanged event handler.

Sample Codes for ColorEditor Server Side Event

We offer two code types for users to set ColorEditor ColorChanged server side event: one is ASP.NET sample code and the other is C#.NET demo code.
If you are programming using ASPX code, please refer to following ColorEditor ColorChanged server side event setting codes.

<kettic:PerColorEditor ID="PerColorEditor1"
Preset="Default" runat="server" AutoPostBack="true"
OnColorChanged="PerColorEditor1_ColorChanged" PaletteModes="all">
</kettic:PerColorEditor>
<asp:Label ID="InformationBox1" runat="server" Style="margin-bottom: 30px;">
Value set from the server-side event handler
<asp:Label ID="Label1" runat="server" Text="None">
</asp:Label>
</asp:Label>
If you are C# developers or end users, you can copy and paste following C# codes directly for programming ColorEditor ColorChanged server side event project.

protected void PerColorEditor1_ColorChanged(object sender, EventArgs e)
{
Label1.Text = ColorTranslator.ToHtml(PerColorEditor1.SelectedColor);
Label1.ForeColor = PerColorEditor1.SelectedColor;
}
Image beneath is a sample screenshot for setting ColorEditor ColorChanged server side event, users can have an intuitive visual effect here.

/how-to/aspnet-ajax/controls-color-editor/color-server-event.jpg

Other Relevant Guides

This page talks about the detailed information on ColorEditor server side event within ASP.NET application, including the specific server side event overview and both the ASPX and C# sample codes for setting server side event. Similar with server side event, there are some specific client side events will occur when users run PerColorEditor control, thus, if you are still interested, you can go ColorEditor client side event tutorial page to get full instructions.
ASP.NET AJAX UI Controls