久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<small id='cfYEI'></small><noframes id='cfYEI'>

  • <tfoot id='cfYEI'></tfoot><legend id='cfYEI'><style id='cfYEI'><dir id='cfYEI'><q id='cfYEI'></q></dir></style></legend>
      <i id='cfYEI'><tr id='cfYEI'><dt id='cfYEI'><q id='cfYEI'><span id='cfYEI'><b id='cfYEI'><form id='cfYEI'><ins id='cfYEI'></ins><ul id='cfYEI'></ul><sub id='cfYEI'></sub></form><legend id='cfYEI'></legend><bdo id='cfYEI'><pre id='cfYEI'><center id='cfYEI'></center></pre></bdo></b><th id='cfYEI'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='cfYEI'><tfoot id='cfYEI'></tfoot><dl id='cfYEI'><fieldset id='cfYEI'></fieldset></dl></div>

      • <bdo id='cfYEI'></bdo><ul id='cfYEI'></ul>

      1. ASP.net C# Gridview ButtonField onclick 事件

        ASP.net C# Gridview ButtonField onclick event(ASP.net C# Gridview ButtonField onclick 事件)
        <legend id='zuXIe'><style id='zuXIe'><dir id='zuXIe'><q id='zuXIe'></q></dir></style></legend>
      2. <tfoot id='zuXIe'></tfoot>

        <small id='zuXIe'></small><noframes id='zuXIe'>

                <bdo id='zuXIe'></bdo><ul id='zuXIe'></ul>
              • <i id='zuXIe'><tr id='zuXIe'><dt id='zuXIe'><q id='zuXIe'><span id='zuXIe'><b id='zuXIe'><form id='zuXIe'><ins id='zuXIe'></ins><ul id='zuXIe'></ul><sub id='zuXIe'></sub></form><legend id='zuXIe'></legend><bdo id='zuXIe'><pre id='zuXIe'><center id='zuXIe'></center></pre></bdo></b><th id='zuXIe'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='zuXIe'><tfoot id='zuXIe'></tfoot><dl id='zuXIe'><fieldset id='zuXIe'></fieldset></dl></div>

                    <tbody id='zuXIe'></tbody>
                  本文介紹了ASP.net C# Gridview ButtonField onclick 事件的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我為一個網上商店類型的項目編寫了一個 ASP 代碼.有一種方法可以將 ProductID 添加到 cookie 并在產品數量上加 1.另一種方法讀取 cookie,將 cookie 轉換為數據表并將其放入 gridview.這個gridview 基本上就是shoppingcart.aspx 頁面.

                  I've written an ASP code for a webshop type project. There is a method that adds the ProductID to a cookie and adds 1 to the quantity of the product. Another method reads the cookie, transforms the cookie to a data table and puts it in a gridview. This gridview basically is the shoppingcart.aspx page.

                  我現在需要的是一種將按鈕字段添加到該網格視圖的方法,我可以在其中添加 ++ 按鈕(如產品頁面上的添加到購物車按鈕),普通的 asp 按鈕采用 onclick="methodname" 但gridview中的這些沒有.

                  What i now need is a way to add a buttonfield to that gridview where i can add a ++ button (like the add to shopping cart button on a product page), normal asp buttons take a onclick="methodname" but these in the gridview don't.

                  add1ToShoppingCart(string productId)
                  {[...]shoppingCartCookie[productId] = (amount + 1).ToString();}
                  

                  這是我用于所有 ++ 按鈕的代碼.它需要 button.id (buttonID=productID).所以我需要一種方法讓所有按鈕都是相同的圖像,但是 buttonID 必須數據綁定到 productID 以便它可以以某種方式執行該方法(使用某種 onclick="").

                  That is the code I use for all the ++ buttons. It takes the button.id (buttonID=productID). So I need a way to have all the buttons be the same image, but the buttonID has to be databound to the productID so it can somehow execute that method (with some sort of onclick="").

                  在過去的幾個小時里,我一直在尋找和搜索,但我似乎找不到任何東西.過去我在stackoverflow上找到了很多答案,所以我希望這里有人可以提供幫助.

                  I've looked and googled for the past couple hours but I cant seem to find anything. In the past I found a lot of answers on stackoverflow so I hoped somebody here could help.

                  提前致謝.

                  推薦答案

                  你可以使用模板字段:

                                       <asp:TemplateField ItemStyle-Width="33px" ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle"
                                              ShowHeader="false" HeaderStyle-Height="40px">
                                              <ItemTemplate>
                                                  <asp:ImageButton ID="btnAddToCard" runat="server" ImageUrl="~/Images/btnAddToCard.png" CausesValidation="false"
                                                      CommandName="AddToCard" CommandArgument='<%# Eval("ID") %>'
                                                      />
                                              </ItemTemplate>
                                              <HeaderStyle Height="40px"></HeaderStyle>
                                              <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="33px"></ItemStyle>
                                          </asp:TemplateField>
                  

                  并在您背后的 C# 代碼中創建 gridview 的以下事件并執行您想要的操作:

                  and in your C# code behind you create the following event of your gridview and do what you want :

                   protected void GV_RowCommand(object sender, GridViewCommandEventArgs e)
                      {
                          if (e.CommandName == "AddToCard")
                          {
                             //Write code to add to card
                          }
                     }
                  

                  GV 是我的 GridView 的 ID!

                  GV is the ID of my GridView !

                  這篇關于ASP.net C# Gridview ButtonField onclick 事件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  What are good algorithms for vehicle license plate detection?(車牌檢測有哪些好的算法?)
                  onClick event for Image in Unity(Unity中圖像的onClick事件)
                  Running Total C#(運行總 C#)
                  Deleting a directory when clicked on a hyperlink with JAvascript.ASP.NET C#(單擊帶有 JAvascript.ASP.NET C# 的超鏈接時刪除目錄)
                  asp.net listview highlight row on click(asp.net listview 在單擊時突出顯示行)
                  Calling A Button OnClick from a function(從函數調用按鈕 OnClick)
                    <tbody id='BmKPn'></tbody>

                        <small id='BmKPn'></small><noframes id='BmKPn'>

                          <bdo id='BmKPn'></bdo><ul id='BmKPn'></ul>

                          <tfoot id='BmKPn'></tfoot>
                        • <i id='BmKPn'><tr id='BmKPn'><dt id='BmKPn'><q id='BmKPn'><span id='BmKPn'><b id='BmKPn'><form id='BmKPn'><ins id='BmKPn'></ins><ul id='BmKPn'></ul><sub id='BmKPn'></sub></form><legend id='BmKPn'></legend><bdo id='BmKPn'><pre id='BmKPn'><center id='BmKPn'></center></pre></bdo></b><th id='BmKPn'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='BmKPn'><tfoot id='BmKPn'></tfoot><dl id='BmKPn'><fieldset id='BmKPn'></fieldset></dl></div>
                        • <legend id='BmKPn'><style id='BmKPn'><dir id='BmKPn'><q id='BmKPn'></q></dir></style></legend>

                            主站蜘蛛池模板: 在线视频日韩精品 | 午夜精品视频在线观看 | 中国一级大毛片 | 欧美综合久久久 | 一片毛片| 精品免费国产一区二区三区四区 | 久久精品99 | 久久久久久久国产 | 中文字幕视频在线 | 久久久久国产一级毛片 | 精品久久久久久久 | 亚洲一区二区三区 | 日韩国产一区 | 91视频免费黄 | 本道综合精品 | 夜夜爽99久久国产综合精品女不卡 | 久久久久国产 | 亚洲欧美国产毛片在线 | 亚洲精品国产第一综合99久久 | 精品国产第一区二区三区 | 91精品国产乱码久久久久久久久 | 亚洲精品一区二区三区蜜桃久 | 99精品欧美一区二区三区综合在线 | aaa天堂| 国产精品久久久久久吹潮 | av在线免费观看网址 | 中文字幕一区二区三区日韩精品 | 精品1区2区 | 伊人狠狠| 国产精品91网站 | av免费网址 | 中文字幕一区二区三区四区不卡 | 成人免费xxxxx在线视频 | 精品综合久久久 | 久草中文在线观看 | 亚洲 欧美 另类 日韩 | 伊人久久综合 | 97国产精品视频人人做人人爱 | 欧美在线一二三 | 欧美日韩精品 | 国产精品视频免费观看 |