在ASP.NET中如何显示.在ASP中我 是在页面要显示的地方用个循环语句+RS("")对记录进行循环读取.不知道在.NET 中怎么实现.如何循环.可以给个例子吗.

解决方案 »

  1.   

    <asp:Repeater ID="rpt_user" runat="server">
    <itemtemplate>
      <tr>
                        <td width="279" height="23"><span class="STYLE11">&nbsp;<a href="b_sanji.aspx?id=<%# container.dataitem("id")%>" title="<%# container.dataitem("b_jiudianname")%>"><span style="color:#000099"><%# leftx(container.dataitem("b_jiudianname").tostring(),42)%></span></a></span></td>
                        <td width="90"><span class="STYLE11">&nbsp;<%# leftx(container.dataitem("b_suozaidi_shi").tostring(),12)%></span></td>
                        <td width="103"><span class="STYLE11">&nbsp;<%# leftx(container.dataitem("b_dianhua").tostring(),14)%></span></td>
                        <td width="102"><span class="STYLE11">&nbsp;<%# leftx(container.dataitem("b_chuanzhen").tostring(),14)%></span></td>
                        <td width="103"><span class="STYLE11">&nbsp;<%# leftx(container.dataitem("b_xingji").tostring(),14)%></span></td>
                        <td width="107"><span class="STYLE11">&nbsp;<%# leftx(container.dataitem("b_lianxiren").tostring(),14)%></span></td>
                      </tr>
    </itemtemplate>
    </asp:Repeater>
      

  2.   

    <asp:Repeater ID="rpt_user" runat="server">
    <itemtemplate>
      <tr>
                        <td width="279" height="23"><span class="STYLE11">&nbsp;<a href="b_sanji.aspx?id=<%# container.dataitem("id")%>" title="<%# container.dataitem("b_jiudianname")%>"><span style="color:#000099"><%# leftx(container.dataitem("b_jiudianname").tostring(),42)%></span></a></span></td>
                        <td width="90"><span class="STYLE11">&nbsp;<%# leftx(container.dataitem("b_suozaidi_shi").tostring(),12)%></span></td>
                        <td width="103"><span class="STYLE11">&nbsp;<%# leftx(container.dataitem("b_dianhua").tostring(),14)%></span></td>
                        <td width="102"><span class="STYLE11">&nbsp;<%# leftx(container.dataitem("b_chuanzhen").tostring(),14)%></span></td>
                        <td width="103"><span class="STYLE11">&nbsp;<%# leftx(container.dataitem("b_xingji").tostring(),14)%></span></td>
                        <td width="107"><span class="STYLE11">&nbsp;<%# leftx(container.dataitem("b_lianxiren").tostring(),14)%></span></td>
                      </tr>
    </itemtemplate>
    </asp:Repeater>