Question

i am trying to pass in a selector into the ID variable but this doesn't seem to work as it blows up at runtime.

what is wrong with the below syntax ?

<script type="text/javascript">
    $(document).ready(function() {

    $(".dblclick").editable('<%=Url.Action("UpdateSettings","Photos", new { id = $(this).attr("id") }) %>', {
            tooltip: "Doubleclick to edit...",
            event: "dblclick",
            style: 'display: inline; width:400px;'
        });

    });

Was it helpful?

Solution

Have you tried

<script type="text/javascript">
    $(document).ready(function() {
    var updateSettingsAction = '<%=Url.Action("UpdateSettings","Photos") %>';
    $(".dblclick").editable(updateSettingsAction + '/?id=' + $(this).attr("id"), {
            tooltip: "Doubleclick to edit...",
            event: "dblclick",
            style: 'display: inline; width:400px;'
        });

    });
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top