我在 GridView 中的一列是一个名为“ViewProfile”的 CommandField 按钮。
单击“ViewProfile”按钮时,事件处理程序“MyGridView_RowCommand(...)”重定向到另一个页面“ViewUserProfile.aspx”。
单击“ViewProfile”并被重定向到“UserProfile.aspx”后,我按下返回按钮。
现在我回到“ViewUsers.aspx”,我单击不属于网格视图的任何其他按钮。
这是有问题的部分......“MyGridView_RowCommand(...)”事件触发了一个事件参数,表明“ViewProfile”按钮被点击了!是的。返回页面时(在重定向之后)单击不在 GridView 内的任何按钮会以某种方式导致引发 RowCommand 事件。奇怪的行为一直持续到我刷新浏览器。
有人知道解决这个问题的方法吗?