如何在用户控件中为单个属性创建多个选择属性? [英] How to create multiple select attribute for single property in user control?

查看:73
本文介绍了如何在用户控件中为单个属性创建多个选择属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里访问我的aspx页面上的用户控件.

Here i am access my user control on my aspx page.

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



如何在用户控件中创建颜色标签,以便我可以获取红色,白色,绿色....等属性,并为它们分配诸如true或false的值.



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.

推荐答案

在您的Usercontrols中定义一个同时具有get和set的公共bool属性.定义尽可能多的属性.

您将可以在设计器中访问它们,并可以为它们设置true/false.
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.


这篇关于如何在用户控件中为单个属性创建多个选择属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆