升级到 .NET 4.5 后,带有 GridView OnRowCommand 和 Linkbutton 的 UserControl 中的事件不会触发 [英] After upgrading to .NET 4.5, event in UserControl with GridView OnRowCommand with Linkbutton doesn't fire

查看:16
本文介绍了升级到 .NET 4.5 后,带有 GridView OnRowCommand 和 Linkbutton 的 UserControl 中的事件不会触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个稳定的应用程序,其中一个功能在从 .NET 4 升级到 .NET 4.5 后突然停止工作.该错误已与未触发的事件隔离,并且已毫无疑问地确认(在 2 个服务器和 3 个工作站上),此错误仅在 .NET 4.5 升级后发生(之前未发生).

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

我有以下几点:

  • 一个只包含用户控件的空 aspx(不要问)
  • 用户控件包含一个在回发后加载内容的 GridView.
  • GridView 包含一个 LinkBut​​ton.
    • 文本来自评估
    • 它还具有设置 CommandArgument 的 OnDataBinding 事件

    OnRowCommand 中的事件在 .NET 4.0 中触发,在 .NET 4.5 中未触发.

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

    有什么线索吗?

    更新

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

    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" 引起的.删除它后,回发工作正常.

    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.

    这篇关于升级到 .NET 4.5 后,带有 GridView OnRowCommand 和 Linkbutton 的 UserControl 中的事件不会触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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