久久久久久久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 事件的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時(shí)送ChatGPT賬號(hào)..

                  我為一個(gè)網(wǎng)上商店類型的項(xiàng)目編寫了一個(gè) ASP 代碼.有一種方法可以將 ProductID 添加到 cookie 并在產(chǎn)品數(shù)量上加 1.另一種方法讀取 cookie,將 cookie 轉(zhuǎn)換為數(shù)據(jù)表并將其放入 gridview.這個(gè)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.

                  我現(xiàn)在需要的是一種將按鈕字段添加到該網(wǎng)格視圖的方法,我可以在其中添加 ++ 按鈕(如產(chǎn)品頁面上的添加到購物車按鈕),普通的 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 必須數(shù)據(jù)綁定到 productID 以便它可以以某種方式執(zhí)行該方法(使用某種 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="").

                  在過去的幾個(gè)小時(shí)里,我一直在尋找和搜索,但我似乎找不到任何東西.過去我在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# 代碼中創(chuàng)建 gridview 的以下事件并執(zhí)行您想要的操作:

                  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 !

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

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

                  相關(guān)文檔推薦

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

                            主站蜘蛛池模板: 日本高清视频在线播放 | 羞羞视频在线观看免费观看 | 久久久www | av中文在线 | 国产成人小视频 | 久久免费精品 | 伊人久操 | 国产成人一区二区 | 久草.com| 日本三级线观看 视频 | 欧美a区| 久久毛片网站 | 日韩三| 99精品欧美一区二区蜜桃免费 | k8久久久一区二区三区 | 99精品一区二区 | 一级片在线观看 | 欧美日韩久久 | 日日干日日射 | 91精品国产91久久久久久 | 欧美a区 | 激情av在线 | 国产精品美女久久久久久免费 | 色婷婷综合久久久中文字幕 | www.一区二区 | 伊人网站| 国产美女永久免费无遮挡 | 精品国产99 | 亚洲黄色一区二区三区 | 人人看人人草 | 一区二区精品 | 成人av一区二区三区 | 中文字幕一区二区三区在线观看 | 精品一区二区三区在线观看国产 | 日韩av一区二区在线观看 | 精品国产鲁一鲁一区二区张丽 | 亚洲一区在线日韩在线深爱 | 日韩三片 | 亚洲视频www| 第四色播日韩第一页 | 欧美成人一区二区 |