This is a migrated thread and some comments may be shown as answers.

Javascript confirmation stops ItemCommand

2 Answers 174 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chameleoki
Top achievements
Rank 2
Chameleoki asked on 08 Jul 2008, 04:13 AM
I have a grid with the following column:

<telerik:GridTemplateColumn HeaderText="" UniqueName="ReOrder">
                            <ItemTemplate>
                               <asp:Button ID="btnReOrder" runat="server" CommandName="ReOrder" Text="ReOrder" OnClientClick="javascript:return confirm('Create a new order from this order template?');" />
                            </ItemTemplate>
                    </telerik:GridTemplateColumn>

The grid is ajaxed with RadAjaxManager.  There is a RadScriptManager on the page.  If I leave the confirmation there, it pops up to confirm but then doesn't do anything after that, not even a page refresh.  If I take off the Javascript, then the ReOrder command fires.

This was/is working with the old RadGrid version (non-ASP.NET AJAX).

2 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 08 Jul 2008, 04:57 AM
Hello Chameleoki,

Here is an example how to achieve this:

<asp:Button ID="btnReOrder" runat="server" CommandName="ReOrder" Text="ReOrder" OnClientClick="if(!confirm('Create a new order from this order template?')) return false;" />

Regards,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Chameleoki
Top achievements
Rank 2
answered on 08 Jul 2008, 05:37 AM
Thank you.  That worked.
Tags
Grid
Asked by
Chameleoki
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Chameleoki
Top achievements
Rank 2
Share this question
or