webpart中的DropdownList没有项目 [英] DropdownList in webpart comes without items
本文介绍了webpart中的DropdownList没有项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个网页如下;
Hi,
I have one webpage like follow;
<asp:CatalogZone ID="CatalogZone1" runat="server">
<ZoneTemplate>
<asp:PageCatalogPart ID="PageCatalogPart1" runat="server" />
<asp:DeclarativeCatalogPart ID="DeclarativeCatalogPart1" runat="server">
<WebPartsTemplate>
<asp:TextBox Text="Test" runat="server" ID="txt1"></asp:TextBox>
<asp:DropDownList EnableViewState="true" runat="server" ID="drp1" title="Option">
<asp:ListItem>One</asp:ListItem>
<asp:ListItem>Two</asp:ListItem>
</asp:DropDownList>
</WebPartsTemplate>
</asp:DeclarativeCatalogPart>
</ZoneTemplate>
</asp:CatalogZone>
当你可以看到DropDownList有两个项目(一,二),enableviewstate也是如此。
现在我将DropDownList添加到WebPartManager.CatalogDisplayMode中的页面; DropDownList没有任何项目,我该怎么办。
As you can see DropDownList has two items (One, Two), enableviewstate is also true.
Now as i add DropDownList to page in WebPartManager.CatalogDisplayMode; DropDownList comes without any item, what should i do.
推荐答案
我找到了一个解决方案。
i可以使用带有项目DropDwonList的UserControl然后你可以在CatalogZone中使用它,现在它有所有项目。
任何人还有其他选择吗?请发帖。
I have found one solution.
i can use UserControl which can have DropDwonList with item and then you can use it in CatalogZone, now it has all the items.
Anybody has other option? Please post.
这篇关于webpart中的DropdownList没有项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文