If you want to submit the value with your form, then you need to add a hidden field:
<label>Discount: <span id="lblDiscountAmount"></span></label>
<input type="hidden" name="DiscountAmount" id="DiscountAmount" />
success: function (data) {
$('#lblDiscountAmount').text(data);
$('#DiscountAmount').val(data);
}
If you want to pass it via an action link, then you'll need to identify those links, and pass the discount amount via the URL:
@Html.ActionLink("Edit", "Edit", new { id = item.Id }, new { @class = "--js-pass-discount" }) |
@Html.ActionLink("Details", "Details", new { id = item.Id }, new { @class = "--js-pass-discount" }) |
@Html.ActionLink("Delete", "Delete", new { id = item.Id })
$(document).on("click", "a.--js-pass-discount", function(e){
var discountAmount = $('#lblDiscountAmount').text();
if (!discountAmount) { return; }
var url = this.href;
var i = url.indexOf('?');
url = url + (-1 === i ? '?' : '&') + 'discountAmount=' + encodeURIComponent(discountAmount);
window.location.href = url;
e.preventDefault();
});