Click here to Skip to main content
15,896,063 members
Articles / Web Development / CSS

Delete Functionality in GridView with Confirmation Using jQuery UI Dialog

Rate me:
Please Sign up or sign in to vote.
4.56/5 (10 votes)
9 Aug 2011CPOL2 min read 58.3K   3.2K   50  
You're using a GridView web control to list records from a particular data source and you want a delete functionality for each row of data. A dialog must be presented to the user to confirm deletion. You also want to show a dialog to the user when an error occurs during deletion.
��

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE PROCEDURE [dbo].[Products_SelectAll]

AS

BEGIN

  SET NOCOUNT ON;

 

  SELECT

  [ProductID],

  [ProductName],

  [SupplierID],

  [CategoryID],

  [QuantityPerUnit],

  [UnitPrice],

  [UnitsInStock],

  [UnitsOnOrder],

  [ReorderLevel],

  [Discontinued]

  FROM [dbo].[Products]



END

GO





SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

CREATE PROCEDURE [dbo].[Products_Delete]

( 

   @productID int

)

AS

BEGIN

  SET NOCOUNT ON;

 

  DELETE FROM [dbo].[Products]

  WHERE [ProductID] = @productID

END

GO

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United States United States
None.

Comments and Discussions