GrdView Postback twice
Background
I am using the GridView with SQLDataSource.
WhenEver i click on grid Delete Command it executes the SP twice.
here is the Delete
parameters and Stored Procedure. If any one having the solution then plz give me chance of thanks.
************************************************** **********
<DeleteParameters>
<asp:Parameter Name="Complaint#" Type="Int32" />
<asp:Parameter name="IsResolved" Type="string" Direction="Output"/>
</DeleteParameters>
************************************************** **********
ALTER Procedure Complaint_Resolved
(
@Complaint# int,
@IsResolved varchar(400) OUT
)
as
--/////////////////////////////////////////////////////////////////
Declare @Complainer_Satisfied int
Select
@Complainer_Satisfied = Count(*)
From dbo.Complaint
Where
Complaint_id = @Complaint# And
Complainer_Satisfied = 1
--/////////////////////////////////////////////////////////////////
IF @Complainer_Satisfied = 0
SET @IsResolved = 'WithOut Complainer' + Char(39) + 's Satisfaction ,You Can' + Char(39) + 't End the Complaint.'
Else
Begin
Update Complaint
Set Date_Resolved = getdate()
Where Complaint_id = @Complaint#
SET @IsResolved = Null
End
SELECT @IsResolved
-------------------------------------------------------------------
|