Hello I am trying to call a method with parameters in my controller using ajax and jquery
Controller:
[HttpPost("{Id}")] 
public ActionResult PostComment(int Id, ShowViewModel model)
{
}
View:
I have a button called AddComment, when clicked it should open a modal popup which asks for confirmation to save
<form id="addCommentForm" asp-action="postcomment" enctype="multipart/form-data">
    <button id="addCommentButton" class="btn btn-primary">
        <i class="fa fa-search"></i> Add comment
    </button>`
    <div class="modal fade" id="saveConfirmationDialog" tabindex="-1" role="dialog" aria-labelledby="saveConfirmationDialogTitle" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="saveConfirmationDialogTitle">Post selective exchange comment</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">×</span>
                    </button>
                </div>
                <div class="modal-body">
                    Do you want to post a comment?
                </div>
                <div class="modal-footer">
                    <button type="submit" class="btn btn-success">
                        <i class="fa fa-envelope-open"></i> Post selective exchange comment
                    </button>
                    <button type="button" class="btn btn-danger" data-dismiss="modal">
                        <i class="fa fa-ban"></i> Close
                    </button>
                </div>
            </div>
        </div>
    </div>
</form>
Javascript:
ControllerName.View.Properties.controllerViewUrl = $("#controllerViewUrl").val();
    $(document).ready(function () {
        ControllerName.View.Validation.initialize();
        ControllerName.View.Initialize.addCommentButton();
    });
    ControllerName.View.Initialize = {}
    ControllerName.View.Initialize.addCommentButton = function () {
        $('#addCommentButton').click(function (event) {
            event.preventDefault();
            if ($('#addCommentForm').valid()) {
                $("#saveConfirmationDialog").modal('show');
            }
        });
    }
    ControllerName.View.Validation = {}
   ControllerName.View.Validation.initialize = function () {
        $("#addCommentForm").validate();
    }
   ControllerName.View.Ajax = {}
    ControllerName.View.Ajax.postComment = function (successCallback) {
        var url = ControllerName.View.Properties.controllerViewUrl + '/PostComment'+<<parameter>>;
    }
My Controller method is not getting called, what am I doing wrong? I also need to pass a Id as parameter
Please help, Thanks in advance
 
    