本文介绍了OnCommand事件没有解雇!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!我在gridview中有一个itemtemplate的问题,我有3个ImageButton和一个调用Img_Command的方法,这是我的asp.net代码:

Hi for everyone! I have a problem with a itemtemplate in a gridview, i have 3 ImageButton and one method that called Img_Command here´s my asp.net code:

<asp:TemplateField>">

   <ItemTemplate>

   <asp:ImageButton ID="imgBtnUpload" OnCommand="Img_Command" CommandName="Upload" 
   ToolTip="Enviar PDA – PDR" ImageUrl="~/Images/APUpload.png" Visible="true" runat="server"/>

   <asp:ImageButton ID="imgBtnProcessado" OnCommand="Img_Command" CommandName="Processado" ToolTip="Lote já processado!" ImageUrl="~/Images/loteProcessado.png"   Visible="false"runat="server"/>

   </ItemTemplate>

</asp:TemplateField>">



这里是我的代码:


and here´s my code behind:

protected void Img_Command(object sender, CommandEventArgs eArgs)
        {
            GridView gdv = (GridView)sender;
            switch (eArgs.CommandName)
            {
                case "Atualizar":
                    break;
                case "Upload":
                    BtnUpload(0);
                    break;
                case "Processado":
                    break;
            }

        }



为什么OnCommand事件没有解雇?



有什么建议吗?



谢谢!


Why the OnCommand event is not firing?

Any suggest?

Thanks!

推荐答案






谢谢,



Duzi。

in the page.

Thanks,

Duzi.


这篇关于OnCommand事件没有解雇!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-16 13:04