delete option in aspx for mysql database with confirmation prompt

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rajsrmc
    New Member
    • Jan 2010
    • 9

    delete option in aspx for mysql database with confirmation prompt

    hello pals!
    i am using mysql database connected in grid view with aspx pages how to use delete option with check boxes (like hotmail inbox)
    suggestions will be really helpful
    thanks in advance
  • ShaluGoogle
    New Member
    • Sep 2009
    • 7

    #2
    Add a Checkbox Column in the datagrieview and keep a link button "Select All" for selecting all checkboxes. Then delete the rows which has been selected.....

    Comment

    • tlhintoq
      Recognized Expert Specialist
      • Mar 2008
      • 3532

      #3
      Database How-to parts 1 and 2
      Database tutorial Part 1
      Database tutorial Part 2

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Once you have added a CheckBox Column, and the user has clicked the delete button you are going to have to loop through each row in the GridView to determine which rows have been checked and then proceed to delete the data.

        I'm not entirely sure where you are having problems though.
        Are you having problems using the "confirmati on prompt"?
        Are you having problems with deleting the data?
        Are you having problems configuring the GridView with CheckBoxes?

        -Frinny

        Comment

        • rajsrmc
          New Member
          • Jan 2010
          • 9

          #5
          Hello Frinny,
          I have added check box in my form and as well confirmation is working too, but in the confirmation prompt, if i click yes the selected record is not getting deleted (i am using mysql and vb code not c#).
          please help with some ideas..
          thanks in advance

          Comment

          • Frinavale
            Recognized Expert Expert
            • Oct 2006
            • 9749

            #6
            I'm still not sure what you're having problems with....if it's your JavaScript that's causing problems....

            Have the submit button return a call to the JavaScript function when it's clicked. That JavaScript function will have to check to make sure that the user wants to delete. If the user clicks No have the function return false...since the button click code also returns false the button click event will be cancelled.

            This is a little hard to describe in words so here's an example of what I'm talking about:

            Code:
            <asp:Button ID="btn_delete" runat="server" OnClientClick="return confirmDelete()" />
            Notice the return...if the confirmDelete function returns false then the OnClientClick will return false...which cancels the click event (and the page does not submit to the server). If the confirmDelete function returns true then the click event will proceed as normal.

            Now, if it's not JavaScript that's causing problems, and it's your C# code that's not working then you're going to have to post the code that you have for deleting so that we can see what you're doing and help you to find the problem. (Please remember to use code tags when posting code)

            -Frinny

            Comment

            Working...