Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 23-04-2009
Member
 
Join Date: Nov 2008
Posts: 3,952
Using the Confirm dialog

I have a button to delete a record that is displayed in a list. The deletion is good to get to, but I would like the user to verify the deletion by pressing Yes in a dialog box asking. Is there an easy way to get to such a message box on the client side?
Reply With Quote
  #2  
Old 24-04-2009
Member
 
Join Date: May 2008
Posts: 2,293
Re: Using the Confirm dialog

This works at least in a Grid View:

Code:
<ItemTemplate> 
<asp: Link Button ID = "Delete" runat = "server" 
OnClientClick = "return confirm ( 'Do you want to delete this record ?');" 
Command Name = "delete"> Delete </ asp: Link Button> 
</ItemTemplate>
Reply With Quote
  #3  
Old 24-04-2009
Member
 
Join Date: Nov 2008
Posts: 3,952
Re: Using the Confirm dialog

Now assumes that this is a DELETE command in any form for .NET component. I'm talking about a button in the interface that is not in some kind of itemtemplate etc.
Reply With Quote
  #4  
Old 24-04-2009
Member
 
Join Date: May 2008
Posts: 2,293
Re: Using the Confirm dialog

I assumes nothing. What I said was:

"This works at least in a Grid View."

You said nothing about the interface.
Reply With Quote
  #5  
Old 24-04-2009
Member
 
Join Date: Nov 2008
Posts: 3,952
Re: Using the Confirm dialog

You're right. But I was looking for a way to get to a CONFIRM. I have tried to put on it but get error while running on the client side
Reply With Quote
  #6  
Old 24-04-2009
Member
 
Join Date: May 2008
Posts: 945
Re: Using the Confirm dialog

If you have a button that performs the deletion (btnDelete in this example), you can fling this in your code:

btnDelete.Attributes.Add ( "onclick", "return confirm ('Are you sure that you are common to delete this)");

Is really just the same as Zecho says. Running a JavaScript dialog box with two buttons. Press 'ok' continues it; press 'cancel' nothing happens.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Using the Confirm dialog"
Thread Thread Starter Forum Replies Last Post
want to confirm that htc rezound is a world phone Kesar Portable Devices 4 11-11-2011 07:22 PM
Any way to confirm ECC functioning Cherokee Motherboard Processor & RAM 6 05-09-2010 05:54 AM
Javascript- Prompt, Alert and Confirm Box example Javiier Software Development 3 08-12-2009 03:20 AM


All times are GMT +5.5. The time now is 01:15 AM.