There is a button on the view
bool isPayAvailable = GetPaymentButtonEnabled(int statusId); <button id="payButton" @(!isPayAvailable ? "disabled" : string.Empty)>Оплатить</button> There is also a button that changes the statusId parameter. It turns out that in the handler for clicking this button there is a code that changes the attribute for the button "Pay". It turns out that there is duplication of code. The question then is: how to call a controller method from a JS file?
@(!isPayAvailable ? "disabled" : string.Empty)- this is the same code that sets the on / off state. or I didn't understand the question - Bald@(...code is responsible for this@(..., which, judging by everything, checks for the presence of isPayAvailable and adds the disabled attribute to the button in the absence of the required data - lexxl