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

                  問題描述

                  限時送ChatGPT賬號..

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

                  我現(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="").

                  在過去的幾個小時里,我一直在尋找和搜索,但我似乎找不到任何東西.過去我在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# 的超鏈接時刪除目錄)
                  asp.net listview highlight row on click(asp.net listview 在單擊時突出顯示行)
                  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.| 日日夜夜草 | 亚洲高清免费 | 男女视频免费 | 视色网| 成人福利在线观看 | 久久毛片视频 | 黄色大片视频 | 欧美一区二区在线视频 | 国产精品毛片va一区二区三区 | 日韩免费观看 | 中文字幕免费在线观看 | 国产精品一区在线播放 | 91精品久久久久久 | 国产1区2区3区 | 一级黄片毛片 | 国产中文字幕视频 | 欧美日韩中文字幕 | 97久久久久 | 91丝袜一区在线观看 | 亚洲激情在线 | 中文字字幕在线中文 | 久久精品一区二区三区四区五区 | 久久久久成人网 | 青草视频在线观看免费 | 在线色网站 | 精品粉嫩小bbwbbwbbw | 97国产精品人人爽人人做 | 日本成人中文字幕 | 国产精品1区 | 三上悠亚激情av一区二区三区 | 激情五月综合网 | 久久99精品国产麻豆91樱花 | 日韩毛片免费看 | 亚洲第一色 | 日韩欧美国产一区二区三区 |