Click here to Skip to main content
15,901,283 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Here i am access my user control on my aspx page.

<uc2:colorcontrol id="ColControl" runat="server" color="Red,White,Green" xmlns:uc2="#unknown" />


How to create color tag in user control so i can get attributes like red,White ,Green.... and assign them a value like true or false.
Posted
Updated 30-Jul-10 21:26pm
v3

1 solution

Define a public bool property in your Usercontrols that has both get and set in it. Define as many properties you want to.

You will be able to access them in the designer and be able to set true/false for them.
 
Share this answer
 
v2
Comments
kapil0411 2-Aug-10 1:19am    
Hi,Sandeep
Thanks for your quick response.
Actually when user types color class property in the user control tag in aspx page, we should get intellisense of nested property (Child property) i.e we will get nested property like color red,blue,green and we can select value true or false accordingly.

Similarly to style tag work.i.e style="color:Red;Width:100%;". .
i have done like this in my user control but i am not able to select multiple color and set value.

bool red,blue,green;
public RainbowClass()
{
red=false;
blue=false;
green=false;
}
public bool Blue
{
get { return blue; }
set { blue=value; }
}

public bool Green
{
get { return green; }
set { green=value; }
}
awating for your response.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900