ASP gridview不触发SelectedIndexChanged [英] ASP gridview not firing SelectedIndexChanged

查看:146
本文介绍了ASP gridview不触发SelectedIndexChanged的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在asp中有一个gridview,在后面的代码中有SelectedIndexChanged事件.我对MasterPage进行了一些更改,现在选择一行时,gridview不会触发SelectIndexChange事件,而是执行PostBack到页面.

我知道gridview会调用javascript __dopostback来选择该行.我可能已经从母版中删除了一个somethig,而该母版现在正在禁用gridview选择事件?

谢谢您.

I have a gridview in asp, and in code behind I have the SelectedIndexChanged event. I made some changes to the MasterPage, and now the gridview, when selecting a row, is not firing the SelectIndexChange event but is doing the PostBack to the page.

I know that the gridview calls a javascript __dopostback to select the row. It is possible that I could have deleted somethig from masterpage that is now disabling the gridview selection event?

thank you

推荐答案

尝试将代码恢复原状,看看是否再次得到事件.如果您这样做,那么我会说您已经大大缩小了问题的范围.
Try putting the code back the way it was, and see if you once again get your events. If you do, then I''d say you pretty much narrowed down the problem.


这是源代码控制和版本历史记录可以节省时间的地方.您可以进行比较以查看发生了什么变化,并可以快速找到可能被意外删除的代码.不能帮助您解决此问题,但将来可能会方便记住这一点.

[更新]
~~~~~~~~~~~

这是对您的评论的回应.

看看该SO线程是否对您有帮助:
http://stackoverflow.com/Questions/485390/why-isnt-the-selectedindexchanged-event-firing-from-a-dropdownlist-in-a-gridview [
This is where source control and version history would have been a time saver. You could have done a comparison to see what changed and could have quickly located the code that may have got accidentally deleted. Not helping you with this one but may be handy to keep this in mind for the future.

[Update]
~~~~~~~~~~~

This is in response to your comment.

See if this SO thread will help you:
http://stackoverflow.com/questions/485390/why-isnt-the-selectedindexchanged-event-firing-from-a-dropdownlist-in-a-gridview[^]


有些事情我们只是不需要了解.我将gridview拖到面板的外面,然后放回去,它就起作用了.

噢,微软...
There are some things that we just don''t need to understand. I drag the gridview outside the Panel, and then I put it back, and it worked.

Awww Microsoft...


这篇关于ASP gridview不触发SelectedIndexChanged的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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