0

I have generated javascript datatable in asp.net. I have brought data using webservice. It is displaying perfectly. I have made the cells editable. But I don't know how to write code for editing. My code is as follows:

    $('#showData').dataTable().makeEditable({
            //"bDestroy": true,
            "sPaginationType": "full_numbers",
            sUpdateURL: "UpdateData.cs"
    "aoColumns": [
                   null,
                   null,
                   null,
                   {
                       indicator: 'Saving Payment Clearance Date...',
                       tooltip: 'Click to edit platforms',
                       type: 'textarea',
                       submit: 'Save changes',
                   }
            ]
        });

I just want to update last column and it provides save button. Now my question is where to impelement UpdateData.cs? Shall I make a class file? How to pass value and row id in that function? Google shows links about php and .net MVC only.

Have used following files:

jquery.dataTables.css

jquery.dataTables.min.js

jquery.dataTables.editable.js

jquery.jeditable.js

jquery.validate.js
15
  • You can try with a [WebMethod] inside UpdateData.cs and then it should look something like this sUpdateURL: "UpdateData.cs\MyUpdateMethod". I personally am using .ashx file as http handle, where I can use the HttpContext. Don't know which one is better, but .ashx serves me well even though it has some mahor disadvantages. Commented Oct 20, 2014 at 7:03
  • Leron if I use class file than why do I require to write [WebMethod] for that? I can directly write what all editing I want in class file itself Commented Oct 20, 2014 at 7:20
  • If you can, then go with it. I highly doubt that you can use datatable without using webmethod or some sort of http handler.. Commented Oct 20, 2014 at 7:27
  • No I dont want to reload page every time. Commented Oct 20, 2014 at 7:30
  • Then use [WebMethod] or HttpHandler. Commented Oct 20, 2014 at 7:40

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.