升级到.NET 4.5后,带有Linkbutton的GridView OnRowCommand的UserControl中的事件不会触发

时间:2022-12-03 22:05:18

I have a stable application where one function suddenly stopped working, after upgrading from .NET 4 to .NET 4.5. The error has been isolated to an event not firing and it has been confirmed beyond any doubt (on 2 servers and 3 workstations), that this error only happens after the .NET 4.5 upgrade (and did not happen before).

从.NET 4升级到.NET 4.5之后,我有一个稳定的应用程序,其中一个函数突然停止工作。错误已被隔离到未触发的事件,并且已经确认(在2台服务器和3个工作站上),此错误仅在.NET 4.5升级之后发生(之前没有发生)。

I have the following:

我有以下内容:

  • An empty aspx that only contains a usercontrol (don't ask)
  • 一个只包含usercontrol的空aspx(不要问)
  • The user control contains a GridView that is loaded with content after a postback.
  • 用户控件包含一个在回发后加载内容的GridView。
  • The GridView contains a LinkButton.
    • The Text comes from an Eval
    • 文本来自Eval
    • It also has an OnDataBinding event that sets the CommandArgument
    • 它还有一个设置CommandArgument的OnDataBinding事件
  • GridView包含一个LinkBut​​ton。 Text来自Eval它还有一个设置CommandArgument的OnDataBinding事件
  • The GridView contains an OnRowCommand.
  • GridView包含一个OnRowCommand。

The event in the OnRowCommand is fired in .NET 4.0 and is not fired in .NET 4.5.

OnRowCommand中的事件在.NET 4.0中触发,并且不会在.NET 4.5中触发。

Any clues?

有什么线索吗?

UPDATE

UPDATE

I simplified my code and got closer to the core of the problem. I found that it was caused by AllowCustomPaging="True" on the GridView. After removing this, the postback works fine.

我简化了我的代码并更接近问题的核心。我发现它是由GridView上的AllowCustomPaging =“True”引起的。删除后,回发工作正常。

1 个解决方案

#1


1  

I simplified my code and got closer to the core of the problem. I found that it was caused by AllowCustomPaging="True" on the GridView. After removing this, the postback works fine.

我简化了我的代码并更接近问题的核心。我发现它是由GridView上的AllowCustomPaging =“True”引起的。删除后,回发工作正常。

#1


1  

I simplified my code and got closer to the core of the problem. I found that it was caused by AllowCustomPaging="True" on the GridView. After removing this, the postback works fine.

我简化了我的代码并更接近问题的核心。我发现它是由GridView上的AllowCustomPaging =“True”引起的。删除后,回发工作正常。