按钮单击事件未触发 [英] Button Click event not firing

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

问题描述

这是我第二次将这个问题放到网上。对不起,但我仍然无法在更新面板中触发按钮事件;

This is the second time im putting this question online. Sorry for that but I still cant get a way to fire a button event inside an update panel;

ID="UpdatePanel3" runat="server" UpdateMode="Always">
       <ContentTemplate>
           <asp:Panel ID="Panel3" runat="server" CssClass="HellowWorldPopup">

           <legend style="font-family: Tahoma; font-size: small; font-weight: bold; font-style: normal; font-variant: normal; text-transform: none; color: #000000; text-decoration: blink"> ICT UNAUTHORIZED USER
      </legend>
               <asp:Button ID="Button3" runat="server" Text="Button"  Style="display:none" />
               <asp:Button ID="Button4" runat="server" Text="OK" onclick="Button4_Click"

                   CausesValidation="true"/>
               <asp:Label ID="Label7" runat="server" Text="Label"></asp:Label>
               &nbsp;</asp:Panel>
           <asp:ModalPopupExtender ID="ModalPopupExtender12" runat="server" PopupControlID="Panel3" Enabled="true"

               TargetControlID="Button3">
           </asp:ModalPopupExtender>

       </ContentTemplate>
       <Triggers>
            <asp:AsyncPostBackTrigger ControlID="Button4" EventName="Click" />


          </Triggers>
   </asp:UpdatePanel>



I真的不知道问题是什么,现在需要一些真正的帮助....



然后在C#:


I really dont know what the issue is and need some real help now please....

then in C# :

protected void Button4_Click(object sender, EventArgs e)
    {
        Response.Redirect("Login.aspx");
    }

推荐答案

您是否处理/定义了验证事件?

控制导致验证,可能你没有处理这个。



尝试在没有
Have you handled/defined validating event?
control causes validation and might be possible u didn't handle this.

try to execute without
CausesValidation="true"

CausesValidation="false"

并查看。


已使用

have checked with
UpdateMode="Conditional"



然后触发器将工作

并且还要检查

点击事件名称


then trigger will works
and also check the
click event name

OnClick


您的代码适用于我,只是尝试使用超链接而不是按钮然后链接该login.aspx到那个超链接
your code works for me, just try to use a hyperlink instead of a button & then link that login.aspx to that hyperlink


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

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