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

[Solved] The requested URL did not return Json

0 Answers 90 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.
Dani
Top achievements
Rank 1
Dani asked on 08 May 2012, 04:34 PM
Here is my grid which is in MyPartialView:


    @(Html.Telerik().Grid<MyClass>()
            .Name("GridMyClass")
            .ToolBar(commands => commands.Insert().ButtonType(GridButtonType.BareImage))
                .DataKeys(keys => keys.Add(a => a.Id))
                        .ClientEvents(events => events.OnError("Grid_onError"))
            .Columns(columns =>
            {
                columns.Bound(p => p.Name).Width(110);
                columns.Bound(p => p.Timestamp).Width(110).Format("{0:MM/dd/yyyy}");
                columns.Command(commands =>
                {
                    commands.Edit().ButtonType(GridButtonType.BareImage);
                    commands.Delete().ButtonType(GridButtonType.BareImage);
                }).Width(180).Title("Edit");
            })
            .DataBinding(dataBinding =>
            {
                dataBinding.Ajax()
                .Select("Ge", "MyClass")
                .Update("Edit", "MyClass")
                .Delete("Delete", "MyClass")
                .Insert("Insert", "MyClass");
            })
        .Pageable()
        .Sortable()
        //.Scrollable()
        //.Groupable()
        //.Filterable()
        //.Editable(editing => editing.Mode(GridEditMode.InLine))
)

Here is one of the controller methods (the others are similar):

    public ActionResult Delete()
        {
            //delete

            //get the model

            List<MyClassTemplate> ct = new List<MyClassTemplate>();
            //fill ct
            return PartialView("MyPartialView", new GridModel<MyClassTemplate> { Data = ct });
        }

And another controller method:

public ActionResult MyPartialView()
        {
            List<MyClassTemplate> ct = new List<MyClassTemplate>();
            //fill ct 
            return PartialView(ct);//new GridModel(ct)
        }

When I edit a row in the grid and click on the image to save the edited row, I step with breakpoints throught the controller methods. Everything is fine. ct has ok value. However, I get alert "Error! The requested URL did not return Json.". Which url did not return json? How to resolve this?
Tags
Grid
Asked by
Dani
Top achievements
Rank 1
Share this question
or