DataGrid DeleteCommand examples flaw

Results 1 to 2 of 2

Thread: DataGrid DeleteCommand examples flaw

  1. #1
    Join Date
    Dec 1969

    Default DataGrid DeleteCommand examples flaw

    Isn&#039;t there a major flaw in the code in the article &#039;An Extensive Examination of the DataGrid Web Control: Part 8&#039; and other similar code samples?<BR>If you implement the code at, now click to delete the first row of your grid - the row is deleted and disappears from your grid, fine.<BR>Now refresh the page (page reposts) - the current first row in the grid is deleted - oopse, not what you wanted.<BR><BR>Because the form post works on the e.Item.ItemIndex (grid row you clicked), it continues to delete whatever data you have in grid row 0 when you repost via a page refresh.<BR><BR>Any simple answer (apart from removing the F5 key from users keyboards)?

  2. #2
    Join Date
    Dec 1969

    Default RE: DataGrid DeleteCommand examples flaw

    set an absolute expiry of the page to 1970 and all the other html headers that cause a page to never be cached . then when you refresh you wont be refreshing the postback - you&#039;ll be making a fresh request for the page

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts