如题,请问一下嵌套的REPEATER控件怎么去遍历它啊?谢谢<asp:repeater id ="r1" runat = server>
<ItemTemplate>
<asp:repeater id ="r2" runat = server>
<ItemTemplate>
</ItemTemplate>
</asp:repeater>
</ItemTemplate>
</asp:repeater>
<ItemTemplate>
<asp:repeater id ="r2" runat = server>
<ItemTemplate>
</ItemTemplate>
</asp:repeater>
</ItemTemplate>
</asp:repeater>
解决方案 »
- 显示元素的问题.
- 断点设置 单步调试
- AspNetPager控件默认每页显示10行,我想让每页显示20行?怎么设置啊?大家帮帮我。
- 请各位大侠帮忙写句简单的sqlserver语句
- 提示:无法创建组件“Microsoft.XMLHTTP”。仅可在带有 页指令的页上创建单元线程组件。什么问题
- .NET初学者,想找下小公司锻炼下自己``
- 关于图片上传的问题
- 求教:关于vbscript对access的操作
- razor语法
- 想完成一个效果,www.xinnuo.net/common/company.aspx,请各位高手帮忙
- masterpage的问题(第一次发贴!)
- 用FreeTextBox1.63出现样式问题?
并根据chekbox是否选择再插入数据库相应的字段
<HeaderTemplate>
<span style="width:190"> 用户权限</span>
<span>用户权限子功能</span>
</HeaderTemplate>
<HeaderStyle Font-Bold="true" BackColor="gold" />
<ItemTemplate>
<table>
<tr>
<td style="width:100">
<asp:Label ID="lblName1" runat="server"></asp:Label>
</td>
<td align="right">
<asp:DropDownList ID="ddlCanUsing1" runat="server">
<asp:ListItem Value="0">可以使用</asp:ListItem>
<asp:ListItem Value="1">不可使用</asp:ListItem>
<asp:ListItem Value="2">不可编辑</asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:DataList ID="dlPopedomFuns" runat="server" OnItemDataBound="dlPopedomFuns_ItemDataBound" DataKeyField="i_oid">
<ItemTemplate>
<table>
<tr>
<td style="width:80">
<asp:Label ID="lblName2" runat="server"></asp:Label>
</td>
<td align="right">
<asp:DropDownList ID="ddlCanUsing2" runat="server">
<asp:ListItem Value="0">可以使用</asp:ListItem>
<asp:ListItem Value="1">不可使用</asp:ListItem>
<asp:ListItem Value="2">不可编辑</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
</td>
</tr>
</table>
</ItemTemplate>
<ItemStyle BackColor="AntiqueWhite" BorderWidth="5" />
<AlternatingItemStyle BackColor="AliceBlue" BorderWidth="5"/>
</asp:DataList>----------------------------------------------------------------------------------------//
protected static DataList dlPopedomFuns = null;//全局变量foreach (DataListItem popedomItem in this.dlUserPopedom.Items)
{
int popedomOID = int.Parse(this.dlUserPopedom.DataKeys[popedomItem.ItemIndex].ToString());
//保存用户权限设置
DropDownList ddlCanUsing1 = (DropDownList)popedomItem.FindControl("ddlCanUsing1");
Popedom popedom = new Popedom(popedomOID);
popedom.Recover();
popedom.CanUsing = (PopedomUsability)ddlCanUsing1.SelectedIndex;
popedom.Save();
//保存用户权限子功能设置
dlPopedomFuns = (DataList)popedomItem.FindControl("dlPopedomFuns");
foreach (DataListItem funItem in dlPopedomFuns.Items)
{
int funsOID = int.Parse(dlPopedomFuns.DataKeys[funItem.ItemIndex].ToString());
DropDownList ddlCanUsing2 = (DropDownList)funItem.FindControl("ddlCanUsing2");
Popedomfuns funs = new Popedomfuns(funsOID);
funs.Recover();
funs.CanUsing = (PopedomUsability)ddlCanUsing2.SelectedIndex;
funs.Save();
}
}//这个是DataList的实例,repeater是一样的
{
foreach (DataListItem funItem in dlPopedomFuns.Items)
}------------这样在子遍历时好象认不到dlPopedomFuns这个ID哦
foreach(RepeaterItem item in this.Repeater1.Items)
{
foreach(RepeaterItem item2 in ((Repeater)item.FindControl("Repeater2")).Items )
{
}
}
已调试成功.我菜,现在才知道原来遍历也可以嵌套哇!!!!!!
for
{
for{}}
for能欠套foreach为啥不能欠套