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

[Solved] RedirectToAction from a [GridAction] method

1 Answer 120 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Luke
Top achievements
Rank 1
Luke asked on 30 Jun 2011, 04:22 PM
Hi Telerik community,

I have two grids on one page.
Upon pressing a "delete" button on one of the grids, both grids need to update (records from both will be removed).

I can think of two ways to go about this:
1) Javascript that gets the other grid to do a refresh after the first one finishes.
2) Update the whole page. (In the context of our application, this is fine and not overkill at all).

I tried option 2 by causing the "delete" GridAction method in the controller to return a RedirectToAction instead of a GridModel. This causes an "Error! The requested URL did not return JSON." dialog to appear, and fails to refresh the page. Is there a way to make this work?

On the other hand, while options 2 seems simpler, do you think option 1 would end up being easier to implement?

Thank you,
Luke

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 01 Jul 2011, 06:48 AM
Hi Luke,

 The only way to handle server redirects  would be to use the OnError event. Perhaps it would be easier to just refresh the second grid using the ajaxRequest method.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Luke
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or