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

Ajax Binding not working "ClientID is not defined"

3 Answers 48 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.
Daniel Collier
Top achievements
Rank 1
Daniel Collier asked on 23 Sep 2010, 07:00 PM
I've set up a basic grid with ajax binding.  it fill the data successfully the first time from the model, but when I try to sort on a column, it calls the ajax method and then nothing happens.  

In Chrome, I get the message "Error! The requested URL did not return JSON."

In Firebug, it breaks on a javascript error, saying:  "ClientID is not defined".

This probably doesn't help, but it breaks on telerik.grid.min.js

I am returning a gridmodel object from my code and that doesn't break, so that part should be okay, right?  The List contains 3 items.
return View(new GridModel(model));


Please help.  

3 Answers, 1 is accepted

Sort by
0
Daniel Collier
Top achievements
Rank 1
answered on 24 Sep 2010, 04:52 PM
I'm an idiot.  My template column content was copied from another grid and it was referencing a field called......ClientID
0
Rafael
Top achievements
Rank 1
answered on 29 Sep 2010, 10:54 AM
did you put  [GridAction] attribute for the controller's method?
Also check do you have  [AcceptVerbs(HttpVerbs.Get)] attribute if you use Ajax binding: if yes - remove that attribute (it helped me) 

0
Daniel Collier
Top achievements
Rank 1
answered on 30 Sep 2010, 07:57 PM
Yes to GridAction, and no i wasn't using acceptverbs.  It was just that I was trying to reference a variable in the clienttemplate, clientid, that was not being passed back in the json.

thanks for your help.
Tags
Grid
Asked by
Daniel Collier
Top achievements
Rank 1
Answers by
Daniel Collier
Top achievements
Rank 1
Rafael
Top achievements
Rank 1
Share this question
or