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

[Solved] Grid Ajax Binding & Authorize Issue

1 Answer 89 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.
SUNG
Top achievements
Rank 1
SUNG asked on 10 Nov 2011, 06:28 AM
Html.Telerik().Grid<Web.Models.GridModel>()
   .DataBinding(
                       dataBinding => dataBinding.Ajax()
                       //.OperationMode(GridOperationMode.Client)
                       .Select("_Grid", "PR")
                   )
I have grid which does ajax binding.
    [GridAction]
    [Authorize]
    public ActionResult _Grid(string filterKeyword)
    {
     GridModel<GridModel> newGrid = new GridModel<GridModel>()
        {
            Data = getList(filterKeyword)
        };
        return View(newGrid);
}
Controller looks like this. If user loose the session/cookie, it will be redirect to the login page. Since this is ajax action, it doesn't redirect. So I'm trying to handle based on the response, but how? I have looked Grid ClientEvents but none of them is useful. using MVC UI Extensions v2011.2.914.340

1 Answer, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 11 Nov 2011, 04:39 PM
Hello Sung,

In the scenario you described, the OnError event will be raised. Basically you should check its result and use client-side navigation to handle such situations.


All the best,

Daniel
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
Grid
Asked by
SUNG
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or