How can I pass a value entered in a texbox to a PartialViewResult?

后端 未结 1 1879
终归单人心
终归单人心 2021-01-28 14:31

I am creating an MVC app where the user can add items to their cart. They can also make partial payments on certain items so I have a TextBox for them to specify how much they w

1条回答
  •  走了就别回头了
    2021-01-28 14:46

    you might try doing an ajax call

    $('.Link').on('click', function(){
        $.ajax({
            url: "@(Url.Action("AddAssignedFee", "Controller")",
            type: "POST",
            data: { textValue: $('.PaymentAmount').val(), data2: 'data2' }
            cache: false,
            async: true,
            success: function (result) {
                $(".Content").html(result);
            }
        });
    });
    

    Hopefully this helps

    0 讨论(0)
提交回复
热议问题