Click here to Skip to main content
15,896,912 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
JavaScript
function btnyesclick() {
        alert("hello");
        var Strno = "AuthorizeSubmit";

        $.ajax({
            url: '/Intimation/Intimation/AuthorizeSubmit',
            type: 'POST',
            contentType: 'application/json; charset=utf-8',
            data: JSON.stringify({ value: Strno, Unchecked: Strno, check: Strno }),
            success: function (result) {
                $('#grid').data('kendoGrid').dataSource.data(result);
            },
            dataType: 'json'
        });
    }



controller

C#
public JsonResult AuthorizeSubmit([DataSourceRequest] DataSourceRequest dsRequest, string Id, string Unchecked, string check) 
        {
            ObservableCollection<string> obcSubmitCollection = new ObservableCollection<string>();
           
            foreach (var item in list)
            {
                if (item.blAuthorizeChk == true)
                {
                    obcSubmitCollection.Add(item.Slno.ToString());
                }
                else if (item.blRejectChk == true)
                {
                    obcSubmitCollection.Add(item.Slno.ToString());
                }
                else if (item.blCancelChk == true)
                 {
                    obcSubmitCollection.Add(item.Slno.ToString());
                }
            }

         
      

            return Json(list);
        }   
Posted
Comments
Amit Jadli 12-Dec-15 3:15am    
i think your controller name is Intimation but you wrote that controller name twice in url...

you could change that as : /Intimation/AuthorizeSubmit
Sathish km 12-Dec-15 3:52am    
thks. i got it.

have another issue from getting checked row data from kendo grid & add it to collection.

var grid = $("#grid").data("kendoGrid");
var row = $("input:checked", grid.tbody).closest("tr");
var item = grid.dataItem(row);

from that above script. i want to filter only required data. How?
Amit Jadli 12-Dec-15 4:20am    
I never used kendo grid in my projects so i don't know about that but i think this link will help you..

http://www.telerik.com/forums/how-to-get-selected-row-and-its-dataitem
Rajdeep Debnath 12-Dec-15 17:16pm    
Hi, it looks MVC is facing exception at model binding level. MVC is unable to modelbind the JSON data which you are passing in HTTP POST request with your ActionMethod parameters.

You can just try with a simple string to pass and with a string parameter in ActionMethod.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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