濮阳杆衣贸易有限公司

主頁 > 知識庫 > repeater 分列顯示以及布局的實例代碼

repeater 分列顯示以及布局的實例代碼

熱門標(biāo)簽:百度地圖標(biāo)注點擊事件 怎樣在地圖標(biāo)注消火栓圖形 濟源人工智能電話機器人價格 杭州智能電話機器人 內(nèi)蒙古智能電銷機器人哪家強 山東防封電銷卡辦理套餐 廈門四川外呼系統(tǒng) 地圖標(biāo)注位置多的錢 泰州手機外呼系統(tǒng)軟件

前臺

復(fù)制代碼 代碼如下:

div>
        table>
            tr>
                asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound">
                    ItemTemplate>
                        td>
                            table>
                                tr>
                                    td colspan="2">
                                        img src='%#"images/"+Eval("FoodPicture") %>' />
                                    /td>
                                /tr>
                                tr>
                                    td colspan="2">
                                        asp:Label ID="Label1" runat="server" Text='%#Eval("FoodName") %>'>/asp:Label>
                                    /td>
                                /tr>
                                tr>
                                    td>
                                        asp:Label ID="Label2" runat="server" Text=' %#Eval("FoodPrice") %>'>/asp:Label>
                                    /td>
                                    td>
                                        input type="image" src="images/product_add.png" onclick="product_add() " />
                                        %--    asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="images/product_add.png" />--%>
                                        asp:TextBox ID="TextBox1" Text="1" runat="server" Width="15px" ReadOnly="True">/asp:TextBox>
                                        input type="image" src="images/product_reduce.png" onclick="product_reduce()" />
                                        %--asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="images/product_reduce.png" />--%>
                                    /td>
                                /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>


后臺

復(fù)制代碼 代碼如下:

  public   int i = 1;               

protected void Page_Load(object sender, EventArgs e)

        {

            string sqlstr = @"data source=PC-LENOVE\SQLEXPRESS;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;

            SqlDataAdapter adapter = new SqlDataAdapter(cmd);

            DataTable dt = new DataTable();

            adapter.Fill(dt);

            cmd.Dispose();

            con.Dispose();

            this.Repeater1.DataSource = dt;

            this.Repeater1.DataBind();

        }

        protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)

        {

            if (i % 4 == 0)//4是一行顯示列數(shù)

            {

                e.Item.Controls.Add(new LiteralControl("/tr>tr>"));

            }

            i++;

        }


您可能感興趣的文章:
  • Repeater的FooterTemplate顯示某列總計思路與代碼
  • Repeater控件動態(tài)變更列(Header,Item和Foot)信息實現(xiàn)思路
  • Repeater對數(shù)據(jù)進行格式化處理
  • Repeater全選刪除和分頁實現(xiàn)思路及代碼
  • ASP.NET中repeater嵌套實現(xiàn)代碼(附源碼)
  • Repeater與ListView功能概述及使用介紹
  • Repeater控件數(shù)據(jù)導(dǎo)出Excel(附演示動畫)
  • asp.net中讓Repeater和GridView支持DataPager分頁
  • 在jquery repeater中添加設(shè)置日期,下拉,復(fù)選框等控件
  • Repeater控件動態(tài)變更列(Header,Item和Foot)信息(重構(gòu)cs)

標(biāo)簽:洛陽 喀什 百色 朝陽 臺州 新鄉(xiāng) 朔州 周口

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《repeater 分列顯示以及布局的實例代碼》,本文關(guān)鍵詞  repeater,分列,顯示,以及,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《repeater 分列顯示以及布局的實例代碼》相關(guān)的同類信息!
  • 本頁收集關(guān)于repeater 分列顯示以及布局的實例代碼的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    镇远县| 恭城| 瓮安县| 微山县| 隆安县| 兴义市| 洪江市| 手游| 大竹县| 嘉黎县| 广水市| 宁陵县| 宜丰县| 崇信县| 吴江市| 梓潼县| 敖汉旗| 潍坊市| 赫章县| 于田县| 禄劝| 扎兰屯市| 辉县市| 华容县| 华安县| 正阳县| 松溪县| 商都县| 河西区| 东乡| 房山区| 尼勒克县| 湖南省| 山阴县| 洛川县| 阆中市| 安义县| 班玛县| 乾安县| 长垣县| 兴文县|