悬赏分:100 该问题已到期 浏览:198 次
在DATALIST1中能再欠套一个DATALIST2 吗?
我用第一个DATALIST1中绑定的一个字段ID做第二个DATALIST2中的参数
现在的问题是那个参数都是 1 这是怎么回事啊?
我在页面DATALIST2中添加了一个自己写的属性
在第一个DATALIST1中绑定到
如:<uc1:AttachmentListCtrl ID="AttachmentListCtrl1" runat="server" ForeignID='<%# Eval("id") %>' KeyID="4" />
|
datalist是可以互相嵌套的
部分代码,仅供参考: <asp:DataList ID="dlLinkGroup" runat="server" DataKeyField="pkId" HorizontalAlign="Left" ItemStyle-VerticalAlign="Top"> <ItemTemplate> <div class="GroupName"> <asp:Label ID="lbGroupName" runat="server" Text='<%#Eval("Name") %>'></asp:Label></div> <div> <div class="LinkListBox"> <asp:DataList ID="dlLink" runat="server" HorizontalAlign="Left" RepeatColumns='<%# Convert.ToInt32(param["LinkRepeatColumn"]) %>' ItemStyle-VerticalAlign="Top" DataSource='<%#GetSystemLinkInfoByLinkGroupId(Convert.ToInt32(Eval("PkId"))) %>'> <ItemTemplate> <div class="Font" style="display:<%#param["LinkType"] =="1" ? "block" : "none" %>"> <asp:HyperLink ID="hlLinkName" runat="server" Text='<%#Eval("Name") %>' NavigateUrl='<%#Eval("Url") %>' Target="_blank"></asp:HyperLink> </div> <div class='Photo' style="display:<%#param["LinkType"] =="1" ? "none" : "block" %>"><a href="<%#Eval("Url") %>" target='_blank'><img src="<%#Eval("ImgUrl") %>" border="0" width="100%" height="100%" /></a></div> </ItemTemplate> </asp:DataList> </div> </ItemTemplate> </asp:DataList> 如果楼主愿意的话,可以看看这篇文章,说得非常详细,也很符合你的问题, http://www.cnblogs.com/ilovejolly/archive/2006/10/17/527593.html |
|
1个月前 yeyang : 我是想在 DataList中使用用户控件啊 使用方法我都知道 现在的我问题是 在页面上不能现实这个用户控件的内容 这是怎么回事? |