Last post Jul 16, 2010 05:20 PM by John Wang
Jan 16, 2009 06:04 PM|vickyshah.se|LINK
I am creating a custom sever Menu control. I have property with name selected color i wana bound this property with Color editor or color picker. So user can select color from color Editor/Picker and i also wana create another property by using that property
user can select image to assign control.
Jan 18, 2009 05:33 AM|joteke|LINK
in order to specify a color, you can assign a type converter to the color attribute. There is for example WebColorConverter class in System.Drawing namespace
public Color SampleColorProperty
And for picking up an image, you can assign a ImageUrlEditor (System.Web.UI.Design namespace, UITypeEditor from System.Drawing.Design namespace) to the property.
public string ImageUrl
Note: you also need references to System.Drawing.dll and System.Design.dll assemblies.
Jan 19, 2009 07:05 AM|vickyshah.se|LINK
Thank you very much it is working fine
Jan 28, 2009 04:36 PM|vickyshah.se|LINK
Hi Teemu Keiski,
I am facing another problem please help.When I add custom server control in aspx page 1st time it works fine but 2nd time it gives me following error.
Error Creating Control
[Property value] cannot be set on property[Name]
Waiting for your reply
Jul 16, 2010 05:20 PM|John Wang|LINK
Thank you joteke. It is very helpful. I have googled this for 4 hours and at last saw your solution, and it works for me(I just tried the WebColorConverter and didn't try the ImageUrlEditor yet). Thank you very much!