Click here to Skip to main content
14,971,029 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
I am getting uncaught type Error: cannot read property ajax of undefined
Here is my Code:

JavaScript
function test()
{
    $.ajax({
        url: '@Url.Action("drawInputs")',
        data: { QueryName: App.About.getValue() }
    })
    .done(function (result) {
        $('#SomeDiv').html(result);
    });
}


HTML
<td>@(Html.X().ComboBox().ID("About").Editable(false)
                                  .ValueField("ID")
                                     .DisplayField("Name")
                                    .Store(Html.X().Store()
                                    .Model(Html.X().Model()
                                    .IDProperty("ID")
                                    .Fields(
                                        new ModelField("ID", ModelFieldType.String) { Mapping = "ID" },
                                        new ModelField("Name", ModelFieldType.String) { Mapping = "Name" }
                                           )
                                         )
                               .Proxy(Html.X().AjaxProxy()
                                        .Url(Url.Action("GetEXTParams"))
                                        .Reader(Html.X().JsonReader().RootProperty("data"))
                                        )
                            )
                                        )
                        .Listeners(li => { li.Select.Handler = "test()"; })
                     )</td>


and I have in the controller action result named "drawInputs" that return partialview
Posted

1 solution

the error was that I am not including jquery.js thats why it is giving such error.
thank you
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900