单击按钮时未处理的事件 [英] Unhandled Event at Button Click

查看:82
本文介绍了单击按钮时未处理的事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

问题:
我的保存按钮不会转到其事件处理程序.

场景-1:
答:我有一个用户控件"GridControl",它具有一个datagridview,每行有一个编辑列.
B.在GridControl的我的用户控件"中,我已经实现了ajax来处理部分回发.我需要它来进行分页和排序.

< asp:UpdatePanel ID = "  runat = "  > 
            
< contenttemplate>
     < asp:GridView ID = "  runat =  " 
          EmptyDataText = "  Width = "  CssClass = "  > 
    
</  contenttemplate  > 

< triggers>
     < asp:AsyncPostBackTrigger ControlID = " />
</ 触发器 >  



场景-2:
A.在我的aspx页面中,我将上述用户控件称为
B.在这个aspx页面中,我有一个div,文本框和保存"按钮.
C.然后,当用户单击用户控件中的编辑"按钮时,将显示编辑div".
D.单击保存"时,保存按钮必须转到其处理程序SaveButton_Click(对象发送者,EventArgs e){...}

问题:
何时:< asp: AsyncPostBackTrigger ControlID ="CommonGridView"/>
为什么单击保存"按钮却无法进入 SaveButton_Click ?

但是在以下情况下:< asp: PostBackTrigger ControlID ="CommonGridView"/>
保存按钮事件处理程序得到执行?

预先感谢您的帮助..

解决方案

更好地粘贴您的整个代码..以便我可以为您提供帮助.


Hello Guys,

Problem:
My save button won''t go to its event handler.

Scenario - 1:
A. I have a user control "GridControl" that has a datagridview that has an edit column per row.
B. Inside GridControl "my user control" I have implemented ajax to handle partial postback. I need this for paging and sorting.

<asp:UpdatePanel ID="Panel1" runat="server">
            
<contenttemplate>
     <asp:GridView ID="CommonGridView" runat="server"
          EmptyDataText="-- No Record Found --" Width="100%" CssClass="Grid">
    
</contenttemplate>

<triggers>
     <asp:AsyncPostBackTrigger ControlID="CommonGridView"/>                    
</triggers>



Scenario - 2:
A. In my aspx page i call the above usercontrol
B. In this aspx page, I have a div, textbox, and save button.
C. And when user click the edit button in the usercontrol the edit div whill showup.
D. When Click save the save button must go to its handler SaveButton_Click(object sender, EventArgs e){...}

Question:
When this: <asp:AsyncPostBackTrigger ControlID="CommonGridView"/>
Why is that if save button click it won''t go to SaveButton_Click?

But when this: <asp:PostBackTrigger ControlID="CommonGridView"/>
the save button event handler gets executed?

Thanks in advance for any help..

解决方案

better paste ur entire code..so that i can help u..


这篇关于单击按钮时未处理的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆