ASP.NET Notes

  • There's apparently a bug in the combination of a GridView and an image ButtonField which causes the OnRowCommand event to fire twice, but only in IE 6 or 7.

    What's really happening is the page is making two requests. You can filter out one of the requests, because only one of the requests contains the X and Y coordinates of the image click. To do this, add this to the top of your OnRowCommand handler:

    if (Request.Params["x"] == null || Request.Params["y"] == null) { return; }

    Or, you can always swap out the ButtonField with a TemplateField and create the image button yourself.

Comments

.Net notes