locked
how to capture text or comments when a record in grid is deleted in asp.net vb (or even C#) RRS feed

  • Question

  • User32934918 posted

    I have a simple asp.net (in vb) app which shows grid-view with rows of data ("requests"). One of the field in the grid-view is "Comments" and this field takes comments from end user when a new "request" is entered. Currently the only button on each row of the grid-view  is "Delete". I have defined triggers on the background table which sends emails to specific users whenever a row is inserted or deleted but not when edited. Just to prevent too many emails, "edit" of request is not allowed (or I should say it is not programmed intentionally but can be done if it is the only way). Currently I have already programmed to show a prompt to ask end-user if s/he really wants to delete a record and upon "yes" response, it deletes the selected row and sends email fine as intended. What I am looking for is: a way to prompt end-user with a text-box where s/he can enter text (or comments) for deletion which gets appended to the previous contents to the "Comments" field and the email is sent (which includes the last comments entered by the end-user at the time of deletion). I am not getting any hits on this and hence requesting help with sample example if any of you have one or any pointers. Thanks in advance! 

    Thursday, June 30, 2016 6:25 PM

Answers

  • User61956409 posted

    Hi rdesai2859,

    What I am looking for is: a way to prompt end-user with a text-box where s/he can enter text (or comments) for deletion which gets appended to the previous contents to the "Comments" field and the email is sent (which includes the last comments entered by the end-user at the time of deletion). 

    You could try to use ModalPopupExtender control to display textbox and confirmation message in a modal popup. You could call .Show() method to show modal popup and get the comments from the current row on GridView RowCommand event (delete command).

    Best Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, July 1, 2016 2:45 AM