views:

119

answers:

2

hi this is the code i am using for confirmation but when clcik on link button it ask me confirmation during the first time if i give ok record is not getting deleted[ only for the first time]

after that records are getting deleted successfully

<asp:LinkButton ID="LinkBtnDelete" runat="server" 
OnClientClick="return confirm('Are you sure you want delete');" 
CommandName="Delete">Delete 
</asp:LinkButton>

any help would be great thank you

+2  A: 

Hai Prince,

Take a look at this it is similar to ur prob

http://stackoverflow.com/questions/335516/simple-javascript-problem-onclick-confirm-not-preventing-default-action

Pandiya Chendur
A: 

Where are you assigning the Click handler?

CommandName does nothing in this context unless the LinkButton is in some repeater? If that's the case, we are missing some code...

Bryan