I have the following code and I'm trying to add a confirmation dialog to the delete button. No matter what I tried I couldn't manage to get the dialog to fire. The latest method I used is this one which I found in a, admittedly, very old thread from this forum. Any ideas?
.aspx file
<telerik:RadListView ID="RadListView1" runat="server" DataSourceID="CompNotesSqlDataSource" >
<ItemTemplate>
<ul>
<li>
<asp:Label ID="TimeLabel" runat="server" Text="Date/Time:"></asp:Label>
<asp:Label ID="TimeText" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "NoteDate","") %>'></asp:Label> <br />
<asp:Label ID="Label19" runat="server" Text="Company:"></asp:Label>
<asp:Label ID="FullNameLabel" runat="server" Text='<%# Eval("Description") %>' />
<br />
<asp:Label ID="Label20" runat="server" Text="Notes:"></asp:Label>
<asp:Label ID="RankLevelLabel" runat="server" Text='<%# Eval("Comments") %>' />
<br />
</li>
<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="updatePanel1">
<ContentTemplate>
<%--<telerik:RadButton ID="btndelete" CommandArgument='<%# Eval("Id")%>' OnCommand="btndelete_Command" runat="server" Text="Delete"></telerik:RadButton>--%>
<telerik:RadButton ID="btndelete" OnClientClick='<%# confirmDelete( Eval("Id").ToString() ) %>' CommandArgument='<%# Eval("Id")%>' OnCommand="btndelete_Command" runat="server" Text="Delete"></telerik:RadButton>
<telerik:RadButton id="btnedit" CommandArgument='<%# Eval("Id")%>' OnCommand="btnedit_Command" runat="server" text="Edit"></telerik:RadButton>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btndelete" EventName="Command" />
<asp:AsyncPostBackTrigger ControlID="btnedit" EventName="Command" />
</Triggers>
</asp:UpdatePanel>
</ul>
</ItemTemplate>
</telerik:RadListView>
----------------------------------
.cs file
public string confirmDelete(string Name)
{
return @"javascript:if(!confirm('This action will delete the "
+ Name
+ @". Are you sure?')){return false;}";
}