Using Atlas ConfirmButtonExtender to display confirm messagebox

Hi

One of the good things about using ATLAS (ASP.NET Ajax extender) is that it makes most of the JavaScript get done without using a single line of java script. The same is true if you want to display a message box to the user when he clicks on a button (lets say a delete or a update button). If the User clicks on the ok button then only the button functionality is performed normally otherwise the button does not perform its normal submit functionality.

The extender can be used with Normal Button, Link button or an image button. The code to use the ConfirmButtonExtender looks like this.

<atlasToolkit:ConfirmButtonExtender ID="cbe" runat="server">
    <atlasToolkit:ConfirmButtonProperties
     TargetControlID="LinkButton1"
     ConfirmText="Are you sure you want to click this?" />
</atlasToolkit:ConfirmButtonExtender>

Here the TargetControlID is the Id of the button control, which will cause the alert message. The ConfirmText is the text to be show in the alert message box.

[Note: You can also use HTML Entities in the ConfirmText]

Hope this helps
Thanks
Vikram


Share this post   Email it |  digg it! |  reddit! |  bookmark it!

Feedback

Posted on 3/30/2007 4:22:15 AM

i'm using this control but i don't know why the page still postback! can you tell me why?
thanks

Posted on 3/30/2007 5:41:28

The page will post back if you press yes on the confirm extender. and not if you press no.

Posted on 12/15/2007 9:32:18

I'm using the ConfirmButtonExtender. It works fine, but i want to display the text of the two buttons "OK" and "Cancel" in Spanish?. How do i do it?. I found this link but could not understand: http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Walkthrough/OtherNeatStuff.aspx

Posted on 3/19/2008 10:19:15 AM

Just wondering, you have this website, which looks nice and seems helpful. However, you have not bothered to update it in I don't know, 2 years? For example the code on this page is invalid, it might have been valid 2 years ago during beta testing, but now there is no confirmbuttonproperties tag in the confirmbuttonextender...

Posted on 3/19/2008 10:20:42 AM

Great! You moderate your comments, I wonder how many people said the same thing and you simply remove the comments.
You my friend are weak.
P.S. What is the point of captcha if you moderate your comments, more weakness.

Please post your comments:

Name:  
Email (optional): Your email address will not be posted.
URL (optional):
Comments: HTML will be ignored, URLs will be converted to hyperlinks  
Enter the text you see in the box:
 
Copyright © 2006 - 2009 Vikram Lakhotia