Memo:ASP.NET主题中设置集合属性

在主题文件中,除了设置单值属性(simple-value properties)外,还可以设置集合属性(collection properties)

例如页面中有:

<asp:RadioButtonList ID="rdoBtnList1" runat="Server">
        <asp:ListItem Text="Apple" Value="1"></asp:ListItem>
        <asp:ListItem Text="Banana" Value="2"></asp:ListItem>
        <asp:ListItem Text="Water Melon" Value="3"></asp:ListItem>
        <asp:ListItem Text="Pineapple" Value="4"></asp:ListItem>
</asp:RadioButtonList>

 

可以在.skin文件中:

<asp:RadioButtonList runat="Server">
        <asp:ListItem Text="Orange" Value="5"></asp:ListItem>
        <asp:ListItem Text="Pear" Value="6"></asp:ListItem>
</asp:RadioButtonList>

 

当然这些.skin中的属性不会应用到页面中相应控件的items上,

当使用Theme时,页面上控件的items被.skin中的items取代:

items变为:

...Orange...

...Pear...

 

当使用StyleSheetTheme时,两者的items合并:

items变为:(.skin中的items在前)

...Orange...

...Pear...

...Apple...

...Banana...

...Water Melon...

...Pineapple...

posted on 2009-11-21 19:23  Archmage  阅读(206)  评论(0)    收藏  举报

导航