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. How to use messagebox to confirm deletion in gridview

How to use messagebox to confirm deletion in gridview

Scheduled Pinned Locked Moved ASP.NET
tutorialquestion
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.
  • T Offline
    T Offline
    There is always the way to do it but I dont know
    wrote on last edited by
    #1

    I have a gridview contians row command field, "Delete", I want to popup a messagebox after user click on "Delete" to confirm deletion before the row has been actually deleted. Any way to do it?

    M 1 Reply Last reply
    0
    • T There is always the way to do it but I dont know

      I have a gridview contians row command field, "Delete", I want to popup a messagebox after user click on "Delete" to confirm deletion before the row has been actually deleted. Any way to do it?

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      There are two options to do that: + In the handler of the RowCreated/RowDataBound event of the GridView control, you can access the Delete button control from a specified cell, and assign the confirm script method to the OnClientClick property of the button control. + Convert the CommandField to the TemplateField, you then easily set the confirm message box to the Delete button.

      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