日期:2014-05-17  浏览次数:20459 次

datalist 里面嵌套repeater
datalist 里面嵌套repeater 如何在显示Repeater1.Items.Count


 <asp:DataList ID="DataList1" runat="server" 
        onitemdatabound="DataList1_ItemDataBound"><ItemTemplate>
                        <asp:Repeater ID="Repeater1" runat="server">
                              <ItemTemplate>

 <select id="perNature<%#Repeater1.Items.Count.ToString()%>" name="perNature">
              <option selected="selected" value="">----请选择----</option>
              <option>1</option>
              <option>2</option>
              <option>3</option>
              <option>4</option>
              <option>5</option>
              <option >6</option>
                          </select>
</ItemTemplate>
                              </asp:Repeater>
 </ItemTemplate>
    </asp:DataList>




------解决方案--------------------
试试
<select id='perNature<%=Repeater1.Items.Count.ToString()%>'>

------解决方案--------------------
<select id="perNature<% Count %>" name="perNature">
Count 是个public的参数,值从后台写
------解决方案--------------------
引用:
datalist 里面嵌套repeater 如何在显示Repeater1.Items.Count


 <asp:DataList ID="DataList1" runat="server" 
        onitemdatabound="DataList1_ItemDataBound"><ItemTemplate>
                        <asp:Repeater ID="Repeater1" runat="server">
                              <ItemTemplate>

 <select id="pe