After upgrading to .NET 4.5, event in UserControl with GridView OnRowCommand with Linkbutton doesn't fire

醉酒当歌 提交于 2019-12-11 10:58:56

问题


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).

I have the following:

  • An empty aspx that only contains a usercontrol (don't ask)
  • The user control contains a GridView that is loaded with content after a postback.
  • The GridView contains a LinkButton.
    • The Text comes from an Eval
    • It also has an OnDataBinding event that sets the CommandArgument
  • The GridView contains an OnRowCommand.

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

Any clues?

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.


回答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.



来源:https://stackoverflow.com/questions/13742156/after-upgrading-to-net-4-5-event-in-usercontrol-with-gridview-onrowcommand-wit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!