repeater 分列显示以及布局的实例代码

2019-05-20 11:58:50丽君

                                </tr>
                                <tr>
                                    <th colspan="2">
                                        <asp:ImageButton ID="ImageButton3" ImageUrl="images/btn_order.gif" runat="server" />
                                    </th>
                                </tr>
                            </table>
                        </td>
                    </ItemTemplate>
                </asp:Repeater>
            </tr>
        </table>
    </div>


后台


  public   int i = 1;               

protected void Page_Load(object sender, EventArgs e)

        {

            string sqlstr = @"data source=PC-LENOVESQLEXPRESS;initial catalog=KFC;USER ID=SA;PASSWORD=abing520";

            SqlConnection con = new SqlConnection(sqlstr);

            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "SELECT * FROM Foods";

            cmd.Connection = con;