meds
meds

Reputation: 22956

Implementing a JavaScript callback in ASP.NET?

I'm trying to convert this piece of JavaScript which sets a callback in PHP to work in ASP.NET MVC 3:

<script type="text/javascript" charset="utf-8">
    $(document).ready(function () {
        /* Init DataTables */
        var oTable = $('#example').dataTable();

        /* Apply the jEditable handlers to the table */
        $('td', oTable.fnGetNodes()).editable('table/examples_support/editable_ajax.php', {
            "callback": function (sValue, y) {
                var aPos = oTable.fnGetPosition(this);
                oTable.fnUpdate(sValue, aPos[0], aPos[1]);
            },
            "submitdata": function (value, settings) {
                return {
                    "row_id": this.parentNode.getAttribute('id'),
                    "column": oTable.fnGetPosition(this)[2]
                };
            },
            "height": "14px"
        });
    });
</script>

So basically trying to work out how to make jEditable work with ASP.NET instead of PHP ...

Upvotes: 0

Views: 181

Answers (1)

Adrien Plisson
Adrien Plisson

Reputation: 23303

the javascript above is not tied to the php: the callback is set within the javascript code. the php page referenced in the code is accessed through http, as any web page.

so basically, you have nothing to change in this javascript, apart from the url of the php page. you only need to rewrite the php script retrieved from this snippet to asp.net.

Upvotes: 1

Related Questions