This question is locked. New answers and comments are not allowed.
Hi.
I'm currently trying to host a Grid in a spark partial and bind it to an ajax request for data. I'm getting a 404 when my grid calls the controller/action.
This is my controller action:
[AcceptVerbs ( HttpVerbs.Get)]
[GridAction ( EnableCustomBinding = true )]
public ActionResult _AjaxAllergyBinding ( )
{
return View ( new GridModel<AllergyRecordEntity>
{
Data = _repository.GetAllergyRecords ( CurrentUser.SelectedPatient ).ToList(),
Total = _repository.GetAllergyRecords ( CurrentUser.SelectedPatient ).ToList ( ).Count
} );
}
This is my Grid code in the spark partial:
<viewdata allergies="IEnumerable[[AllergyRecordEntity]]" />
<div class="recordblock">
<%
Html.Telerik ( ).Grid<AllergyRecordEntity> ( allergies )
.Name ( "Allergies" )
.Columns ( columns =>
{
// -> Html helper retrieves column title text using culture and static list class
columns.Add ( x => x.Allergen ).Title ( Html.GetResourceText ( CultureString , TranslateText.Allergen ) );
columns.Add ( x => x.Symptom ).Title ( Html.GetResourceText ( CultureString , TranslateText.Symptom ) ).Format ( "{0:dd/MM/yy}" );
columns.Add ( x => x.Specialist.NameDetail ( ) ).Title ( Html.GetResourceText ( CultureString , TranslateText.Doctor ) );
} )
.Ajax ( settings => settings.Action ( "_AjaxAllergyBinding" , "Allergy" ) )
.Pageable ( settings => settings.Total ( ( int ) ViewData [ "total" ] ) )
.EnableCustomBinding ( true )
.Sortable ( )
.Render ( );
%>
</div>
The error is stating: Error! The requested URL "/Allergy/_AjaxAllergyBinding" returned 404 - Not found
The page is first loaded from it's parent page with a list of objects and the grid is populated. When clicking the refresh button in the bottom left corner, I get the error. The controller action isn't hit on debug either.
Is there something I am missing?
Cheers,
H.