Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Confirmation of Delete in datagrid not working

Confirmation of Delete in datagrid not working

Scheduled Pinned Locked Moved ASP.NET
javascriptcssdesignsysadminhelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sivaprasad C
    wrote on last edited by
    #1

    Hi, I have a dategrid were i have a link button for delete. In the item data bound i am adding an onclick atribute for the link button to popup the msgbox. In Item command I am writing the logic for delete.. the columns in the grid are dynamically created from the codebehind and not in the design part... My problem is when I click the delete link I am geting the msgbox..If I click ok the page is not posted back to the server and the row is also not deleted... in Item data bound the code is : ((LinkButton)e.Item.Cells[9].Controls[0]).Attributes.Add("onclick","javascript:return ConfirmDelete();"); the javascript added in the .aspx part is : function ConfirmDelete() { if(confirm('Do You Want to Delete?')) { return true; } return false; }

    Regards, Sivaprasad

    _ 1 Reply Last reply
    0
    • S Sivaprasad C

      Hi, I have a dategrid were i have a link button for delete. In the item data bound i am adding an onclick atribute for the link button to popup the msgbox. In Item command I am writing the logic for delete.. the columns in the grid are dynamically created from the codebehind and not in the design part... My problem is when I click the delete link I am geting the msgbox..If I click ok the page is not posted back to the server and the row is also not deleted... in Item data bound the code is : ((LinkButton)e.Item.Cells[9].Controls[0]).Attributes.Add("onclick","javascript:return ConfirmDelete();"); the javascript added in the .aspx part is : function ConfirmDelete() { if(confirm('Do You Want to Delete?')) { return true; } return false; }

      Regards, Sivaprasad

      _ Offline
      _ Offline
      _AK_
      wrote on last edited by
      #2

      The code seems to correct to me. I think the page should get postback.

      Best Regards, Apurva Kaushal

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups