Break Point未在button_Click事件中触发。 [英] Break Point has not fired in button_Click event.

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

问题描述

亲爱的先生,

在这个项目中,我遇到了一个问题。在此页面中,我无法通过按钮单击事件到达。断点在页面加载时命中,但不能处理任何按钮,因此代码在运行时没有执行。

在设计部分:



Dear sir,
In this project I'm facing a problem. In this page the I couldn't reached at the button click event. The breakpoints hits at the page load, but not working any of the buttons and so code has not executed at the run time.
In the Design Part:

<asp:Button ID="btnSubmit" runat="server" Text="Submit"
          CssClass="btn" onclick="btnSubmit_Click1" />
          <asp:Button
          ID="btnCancel" runat="server" Text="Cancel" CssClass="button"
          onclick="btnCancel_Click" />





代码部分:





In the Code Part:

protected void Page_Load(object sender, EventArgs e)
    {
       // lblMsg.Text = "Data submitted successfully...";
    }







protected void btnSubmit_Click1(object sender, EventArgs e)
   {
       lblMsg.Text = "Data inserted successfully...";
   }
   protected void btnCancel_Click(object sender, EventArgs e)
   {
       resetText();
   }









我发现错误是在我的母版页面。当我添加一个不包括母版页的新页面时,所有东西都工作正常,当我通过母版页添加它时,按钮点击事件不会触发,那么母版页中的错误是什么,我找不到。





I found that the error is in my Master Page. When I add a new page excluding Master Page all the thing are worked fine and when I add it through Master page then button click event does not fire, So what is the error in Master Page I could not found.

推荐答案

一些可以帮助你的链接 -

为什么调试器不能达到你的断点? [ ^ ]

断点没有被击中 [ ^ ]

WHy断点没有命中? [ ^ ]
Some links that could help you -
Why the debugger will not hit your breakpoints?[^]
Breakpoints not being hit[^]
WHy breakpoint does not hit?[^]


我已经解决了。实际上我的母版页面中有两个表单标签,因此代码不能很好地工作。现在它可以正常工作。
I have solved it. Actually there are two form tag in my Master page, so the code does not work perfectly. Now it works correctly.


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

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