views:

1543

answers:

3

Hello friends

i am trying to create a confirm box similar to Hotmail's Confirm box when we click on the Empty Folder in the Junk Mail folder.

but i am unable to figure it's working and the logic behind it.

i am using ASP.Net 2 in VS 2005 Pro.

is there any special logic which goes behind the working of the confirm box like the one used in Hotmail, or a custom control. which works on the basis of button pressed or action taken like OK or Cancel.

Looking for favorable replies.

+3  A: 

I'm not familiar with the Hotmail confirm box you're refering to, but Javascript comes with a confirm() function that's easy to use. See here for more details.

Yuval
+1  A: 

For a simple confirm box you can do the following:

 <asp:LinkButton ID="LinkButton1" runat="server" 
             OnClientClick="return confirm('Are you sure you want to delete?');"
             OnClick="LinkButton1_Click">
  Delete</asp:LinkButton>

That will show a confirm dialog, and the Server-Side Click event will be executed only if the user selects Ok.

CMS
A: 

As well as the above method you can also use the ConfirmButton extender from the AjaxControlTookit to do this. The advantage of the ConfirmButton extender is that it can pop-up a modal window as well as a conventional JavaScript confirm alert.

Dan Diplo