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

[Solved] Server error with Ajax binding

2 Answers 219 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.
Sean Cross
Top achievements
Rank 1
Sean Cross asked on 16 Nov 2009, 01:43 AM
I am getting an error when I try to use ajax binding:
Error! The requested URL "/ACC/ToDoItemsBinding" returned 500 - Internal Server Error

The relevant controler code is:

        [GridAction]
        public ActionResult ToDoItemsBinding()
        {
            var items = from i in CmsUser.ToDoItems
                        where !i.CompletedDate.HasValue
                        orderby i.DueDate
                        select i;

            return View(new GridModel<ToDoItem>
            {
                Data = items
            });
        }


        // GET: /Acc/ToDoItems/
        // partial view showing todo items for the current user
        public ActionResult ToDoItems()
        {
            var items = from i in CmsUser.ToDoItems
                        where !i.CompletedDate.HasValue
                        orderby i.DueDate
                        select i;
            return View(items);
           // return View();
        }
The relevant view code is
    <%
        Html.Telerik().Grid(Model)
            .Name("ToDoGrid")
            .Ajax(ajax => ajax.Action("ToDoItemsBinding", "ACC"))
            .Columns(columns =>
                {
                    columns.Add(t => t.ClaimReference).Format(Html.ActionLink("{0}", "ClaimNumber", new { Id = "{0}" })).Encoded(false);
                    columns.Add(t => t.Task).Format(Html.ActionLink("{0}", "ToDoItem", new { Id = "{0}" })).Encoded(false).Title("TaskF");
                    columns.Add(t => Html.ActionLink(t.Task, "ToDoItem", new { Id = t.Id })).Encoded(false).Title("TaskI");

                    columns.Add(t => t.DueDate).Format("{0:d}");
                    columns.Add(t => t.Completed ? "Yes" : "").Title("Completed");
                    columns.Add(t => Html.ActionLink(t.Completed ? "Mark uncompleted" : "Mark completed", "ToggleToDoItem", new { Id = t.Id })).Encoded(false).Title("");                    
                })
            .Pageable()
            .Sortable()        
            .Render();               
    %>

I am using Lightspeed as my ORM.

Any ideas where to look?

Sean



2 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 16 Nov 2009, 10:16 AM
Hello Sean,

Unfortunately I am not able to determine what could cause the depicted issue. I will suggest you debug the problem and review what is the actual error returned from the server. You could use Firebug to determine what is the response.

Kind regards,
Georgi Krustev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Sean Cross
Top achievements
Rank 1
answered on 16 Nov 2009, 09:19 PM
Thanks for the firebug tip.  The problem was a circular reference in my object graph.
Tags
Grid
Asked by
Sean Cross
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Sean Cross
Top achievements
Rank 1
Share this question
or