خرید بک لینک

Vote count: 0

I load a partial view through ajax action link.

 @Ajax.ActionLink(" ", "adduser", "users", new { useame = item.UserName  }, new AjaxOptions() { UpdateTargetId = "add_research" }, new { @class = "glyphicon glyphicon-link" })

I pass it to controller like

public ActionResult AddUser(string useame)

in my ajax code I have

function bindForm(dialog) {
$('form', dialog).submit(function () {
    $('#progress').show();
    $.ajax({
        url: this.action,
        type: this.method,
        data: $(this).serialize(),
        cache: false,
        success: function (result) {
            if (result.success) {
                $('#myModal').modal('hide');
                $('#progress').hide();
                //location.reload();
               $("#add_research").load('/Assistants/AddUser');

            } else {
                $('#progress').hide();
                $('#myModalContent').html(result);
                bindForm();
            }
        }
    });
    retu false;
});

}

When I first click the ajax actionlink my query retus ok and it brings the results. Its partial vie with a webgrid with rows and delete action. When I click the delete button I have a modal that asks if the user is sure about this action. Then I need to reload the partial view but I get "Object reference not set to an instance of an object." message about my model. Any idea on how to keep the data and post them again to the controller? thank you!

asked 28 secs ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 3 تير 1395 ساعت: 20:02

صفحه بندی