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...