简体   繁体   English

asp.net按钮事件触发问题

[英]asp.net Button event firing problem

I am using an asp Button the following way: 我通过以下方式使用asp Button:

<asp:Button ID="ButtonSave" runat="server" Text="Save" OnClick="ButtonSave_Click" />

and the code of the handler looks something like this: 处理程序的代码如下所示:

protected void ButtonSave_Click(object sender, EventArgs e)
{
   Authenticate();

   //some other code here

   //redirect to certain page here
}

While debugging, I put a breakpoint at Authenticate, but it seems that it doesn't enter the function, although the redirection takes place and i don't do any more redirecting in the file only this one. 在调试时,我在Authenticate处设置了一个断点,但似乎没有输入该函数,尽管发生了重定向,并且仅此一个,我不再在文件中进行任何重定向。 I don't understand what's going on, so if anyone could help i would be very grateful. 我不知道发生了什么,所以如果有人可以帮助我将不胜感激。

There are multiple possible reasons. 有多种可能的原因。 Four: 四:

  • You are not actually surfing to the application (version) that's hooked into the debugger: something that may happen if you're using IIS to host the application at the same time as you're creating debug instances on the fly (check your ports). 您实际上并不是在浏览与调试器关联的应用程序(版本):如果您在动态创建调试实例的同时使用IIS来承载应用程序,则可能会发生这种情况(检查端口) 。
  • The app has gone 'out of sync'. 该应用已“不同步”。 Rebuild / reload. 重建/重新加载。
  • Make sure you're doing a 'debug' build. 确保您正在执行“调试”构建。
  • Make sure the options Enable ASP Debugging and Enable ASP.NET Debugging are not set to False 确保选项“启用ASP调试”和“启用ASP.NET调试”未设置为False。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM