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

[Solved] grid ajax binding

6 Answers 512 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.
lhar gil
Top achievements
Rank 1
lhar gil asked on 21 Apr 2010, 05:16 PM
hello,

i am currently at a loss as to why grid ajax binding is not working for me.. i patterned the solution to the telerik mvc demos. however, it always gives me an internal server error 500. see below for my controller and view code:

// controller 
public class HomeController : Controller 
    { 
        private CollegeDAL _college = new CollegeDAL(); 
 
        public ActionResult AjaxBinding() 
        { 
            return View(); 
        } 
 
        [GridAction] 
        public ActionResult _AjaxBinding() 
        { 
            List<ECollege> collegeList = new List<ECollege>(); 
            try 
            { 
                collegeList = _college.ListOfColleges(); 
            } 
            catch (Exception ex) 
            { 
                throw ex; 
            } 
            finally 
            { 
                _college = null
            } 
            return View(new GridModel(collegeList)); 
        } 
    } 
 
// view 
<h2>AjaxBinding</h2> 
    <% Html.Telerik().Grid<ECollege>() 
        .Name("Grid") 
        .Columns(columns => 
            { 
                columns.Bound(o => o.CollegeCode).Width(50); 
                columns.Bound(o => o.CollegeName).Width(100); 
            }) 
        .DataBinding(databinding => databinding.Ajax().Select("_AjaxBinding", "Home")) 
        .Pageable() 
        .Sortable() 
        .Scrollable() 
        .Groupable() 
        .Filterable() 
        .Render(); 
        %> 
 


can you please enlighten me as to why this is happening? 

thank you.




6 Answers, 1 is accepted

Sort by
0
IQworks
Top achievements
Rank 1
answered on 21 Apr 2010, 08:46 PM

Hi Ihar,

     I have had issues with using Render(); along with Ajax binding ?

0
lhar gil
Top achievements
Rank 1
answered on 22 Apr 2010, 01:16 AM
i tried not using the Render(); method, i still have the error 500. i reckon that there might be some setting i might have missed configuring? 
0
IQworks
Top achievements
Rank 1
answered on 22 Apr 2010, 02:24 AM

Hi Ihar,

   I should of asked about the specifics of that 500 error ? 
  

0
lhar gil
Top achievements
Rank 1
answered on 22 Apr 2010, 02:36 AM
i think i also forgot to mention the specifics of the error.

upon executing the program, a javascript alert window pops up with the following error:

<localhost> 
 
Error! The requested URL returned 500 - Internal Server Error 

and then it tells me to "Stop executing scripts on this page." I am using Opera as my browser, if that should matter also. 
0
lhar gil
Top achievements
Rank 1
answered on 22 Apr 2010, 04:42 AM
I just found a solution. It had something to do with the associations' visibility and references, as generated by EF. Ajax is on. :)
0
Vir
Top achievements
Rank 1
answered on 14 Mar 2011, 10:45 PM
Ihar
can you write specifically about the solution you found? I am getting exact same error. I have not found the solution yet. 

Thanks
Vir
Tags
Grid
Asked by
lhar gil
Top achievements
Rank 1
Answers by
IQworks
Top achievements
Rank 1
lhar gil
Top achievements
Rank 1
Vir
Top achievements
Rank 1
Share this question
or