ColorPicker
ColorPicker
Overview
This sample shows the basic usage of the ColorPicker control.
Features
#ffffff
Settings
Show Alpha Channel: True
Show Color String: False
Description
This sample shows the basic usage of the ColorPicker control.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using MvcExplorer.Models; namespace MvcExplorer.Controllers { public partial class ColorPickerController : Controller { public ActionResult Index() { ViewBag.DemoSettings = true ; ViewBag.DemoSettingsModel = new ClientSettingsModel { Settings = CreateSettings() }; return View(); } private static IDictionary< string , object []> CreateSettings() { var settings = new Dictionary< string , object []> { { "ShowAlphaChannel" , new object []{ true , false }}, { "ShowColorString" , new object []{ false , true }} }; return settings; } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 | @using System.Drawing @ { ClientSettingsModel settings = ViewBag.DemoSettingsModel; } < div > < label > @Html .Raw(Resources.ColorPicker.Index_ColorPicker)</ label > @Html .C1().ColorPicker().Id(settings.ControlId).Palette(Color.Red, Color.Green, Color.Blue).Width(400) </ div > @section Description{ @Html .Raw(Resources.ColorPicker.Index_Text0) } |