Color25
Color25 is a color picker control that allows users to select a color from a visual palette.
It returns the selected color value and supports different sizes and custom width options.
Parameters
- ControlId (mandatory)
- Unique identifier for the color picker.
- Must match the model variable name to bind and retrieve values correctly.
- Used to access the selected value in the controller.
- Value (mandatory)
- The currently selected color value.
- Returned exactly as selected by the user.
- Must match the model variable name for correct binding.
- Label (optional)
- A caption or title displayed near the color picker.
- Size (optional)
- Controls the width of the color picker.
- Available values: S1, S2, S3, S4, S5, Max, Auto.
- S1: 50px width
- S2: 100px width
- S3: 150px width
- S4: 200px width
- S5: 250px width (default)
- Max: full width
- Auto: adjusts automatically based on content
- CustomWidth (optional)
- Allows entering a custom width value for the color picker.
- If both Size and CustomWidth are provided, CustomWidth will override Size.
Sample Code
string HtmlStr = "";
HtmlStr += Color25.GetHtml("FavColor", Model.FavColor, "Color", Color25.Size.S3);