pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

<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="xhkr332" 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="ynqybyb" 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賬號..

                  我為一個(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="slkaolu" 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>

                            主站蜘蛛池模板: 机房监控|动环监控|动力环境监控系统方案产品定制厂家 - 迈世OMARA | 石家庄救护车出租_重症转院_跨省跨境医疗转送_活动赛事医疗保障_康复出院_放弃治疗_腾康26年医疗护送转诊团队 | 河南生物显微镜,全自动冰冻切片机-河南荣程联合科技有限公司 | 河北凯普威医疗器材有限公司,高档轮椅系列,推车系列,座厕椅系列,协步椅系列,拐扙系列,卫浴系列 | 高博医疗集团上海阿特蒙医院| 高效复合碳源-多核碳源生产厂家-污水处理反硝化菌种一长隆科技库巴鲁 | 中国玩具展_玩具展|幼教用品展|幼教展|幼教装备展 | 升降机-高空作业车租赁-蜘蛛车-曲臂式伸缩臂剪叉式液压升降平台-脚手架-【普雷斯特公司厂家】 | 医疗仪器模块 健康一体机 多参数监护仪 智慧医疗仪器方案定制 血氧监护 心电监护 -朗锐慧康 | RS系列电阻器,RK_RJ启动调整电阻器,RQ_RZ电阻器-上海永上电器有限公司 | 全国冰箱|空调|洗衣机|热水器|燃气灶维修服务平台-百修家电 | 花纹铝板,合金铝卷板,阴极铝板-济南恒诚铝业有限公司 | 标准件-非标紧固件-不锈钢螺栓-非标不锈钢螺丝-非标螺母厂家-三角牙锁紧自攻-南京宝宇标准件有限公司 | 东莞螺杆空压机_永磁变频空压机_节能空压机_空压机工厂批发_深圳螺杆空压机_广州螺杆空压机_东莞空压机_空压机批发_东莞空压机工厂批发_东莞市文颖设备科技有限公司 | TTCMS自助建站_网站建设_自助建站_免费网站_免费建站_天天向上旗下品牌 | 礼仪庆典公司,礼仪策划公司,庆典公司,演出公司,演艺公司,年会酒会,生日寿宴,动工仪式,开工仪式,奠基典礼,商务会议,竣工落成,乔迁揭牌,签约启动-东莞市开门红文化传媒有限公司 | 工作心得_读书心得_学习心得_找心得体会范文就上学道文库 | 方源木业官网-四川木门-全国木门专业品牌 | 防火门|抗爆门|超大门|医疗门|隔声门-上海加汇门业生产厂家 | 山东led显示屏,山东led全彩显示屏,山东LED小间距屏,临沂全彩电子屏-山东亚泰视讯传媒有限公司 | 搪玻璃冷凝器_厂家-越宏化工设备 | X光检测仪_食品金属异物检测机_X射线检测设备_微现检测 | 橡胶接头|可曲挠橡胶接头|橡胶软接头安装使用教程-上海松夏官方网站 | 新材料分散-高速均质搅拌机-超声波分散混合-上海化烁智能设备有限公司 | 必胜高考网_全国高考备考和志愿填报信息平台 | 无锡市珂妮日用化妆品有限公司|珂妮日化官网|洗手液厂家 | 机构创新组合设计实验台_液压实验台_气动实训台-戴育教仪厂 | 紫外荧光硫分析仪-硫含量分析仪-红外光度测定仪-泰州美旭仪器 | EPDM密封胶条-EPDM密封垫片-EPDM生产厂家 | 中式装修设计_全屋定制家具_实木仿古门窗花格厂家-喜迎门 | 河南新乡德诚生产厂家主营震动筛,振动筛设备,筛机,塑料震动筛选机 | 生产自动包装秤_颗粒包装秤_肥料包装秤等包装机械-郑州鑫晟重工科技有限公司 | 空调风机,低噪声离心式通风机,不锈钢防爆风机,前倾皮带传动风机,后倾空调风机-山东捷风风机有限公司 | 量子管通环-自清洗过滤器-全自动反冲洗过滤器-北京罗伦过滤技术集团有限公司 | 步入式高低温测试箱|海向仪器 | 耳模扫描仪-定制耳机设计软件-DLP打印机-asiga打印机-fitshape「飞特西普」 | 附着力促进剂-尼龙处理剂-PP处理剂-金属附着力处理剂-东莞市炅盛塑胶科技有限公司 | 除甲醛公司-甲醛检测-广西雅居环境科技有限公司 | 引领中高档酒店加盟_含舍·美素酒店品牌官网 | 雾度仪_雾度计_透光率雾度仪价格-三恩时(3nh)光电雾度仪厂家 | 400电话_400电话申请_888元包年_400电话办理服务中心_400VIP网 |