repeater 绑定数组

后台Cs写法

 

string keyword = basic.GuanJianZi;
            string[] a = keyword.Split(new char[] { '\n' });
            Repeater2.DataSource = a;
            Repeater2.DataBind();

 

前台

 

<asp:Repeater ID="Repeater2" runat="server">
      <ItemTemplate>
      <tr>
        <td height="24" align="left">&middot; <a href="Sear_Com.aspx?KeyWord=<%#GetDataItem() %>"><%#GetDataItem()%></a></td>
      </tr>
      </ItemTemplate>
      </asp:Repeater>

你可能感兴趣的:(数组)