Showing a Confirmation Dialog When Using Telerik AJAX

by Al Beecy December 28, 2008
Normally, when you want to show a Javascript confirmation dialog (for instance, when deleting something), you'd either do it in code-behind as follows:

btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete the selected items?');");

or in the aspx as:

OnClientClick="return confirm('Are you sure you want to delete this item?');"

But the normal ways don't seem to work when using Telerik AJAX.  To make it work, do this:

OnClientClick="if(!confirm('Are you sure you want to delete the selected items?')) return false;"

Don't ask me why...

Tags:

Asp.Net | Telerik

Comments

December 28, 2008 #

DotNetKicks.com

Trackback from DotNetKicks.com

Showing a Confirmation Dialog When Using Telerik AJAX

DotNetKicks.com

January 23, 2009 #

Web Development Community

Trackback from Web Development Community

Showing a Confirmation Dialog When Using Telerik AJAX

Web Development Community

February 17, 2009 #

Nadav Yeheskel

Thank you very much!! It is driving me crazy for some time... Smile

Nadav Yeheskel,
Any Technologies.
http://www.any-techs.com

Nadav Yeheskel Israel

Powered by BlogEngine.NET1.5.0.7 | Theme by Mads Kristensen