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

[Solved] Ajax databinding action is not regconized.

0 Answers 67 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.
Alex
Top achievements
Rank 1
Alex asked on 06 Jun 2012, 09:54 PM
Hello Telerik,

I have an issue with dataBinding.Ajax().Select call.

Here is my file hierarchy

Areas\History\Controllers\HistoryController.cs
Areas\History\Views\History\List.cshtml
    

Here is a portion of my List.cshtml

 

.DataBinding(dataBinding => dataBinding.Ajax().Select("GetHistories", "History"))

The HistoryController has an action GetHistories().

[GridAction]
public ViewResult GetHistories()
{
     List<HistoryView> lhv = new List<HistoryView>();           
     return View(new GridModel<HistoryView>(lhv));
}

Inside area registration...

 

public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
   "History_default",
    "History/{action}/{dataType}/{id}/{version}",
    new { controller = "History", action = "Index", dataType = UrlParameter.Optional, 
                id = UrlParameter.Optional,   version = UrlParameter.Optional });
}

The ajax binding does not work. I got a 404 error - Not Found. During debugging, I saw the controller ctor got called, but the action GetHistories() is never got called. Using the developer tools (network), I found that the select call was translated to a 'null' action. ...\History\null

Could  you please help.

Alex Nguyen

Tags
Grid
Asked by
Alex
Top achievements
Rank 1
Share this question
or