I have the following HTML
@model ModernTyres.GO.Common.Models.EmpDocumentModel<input type="text" name="Claim" class="form-control" id="TxtClaim" asp-for="Claim" data-role="text" disabled /><script>$(document).ready(function () {
SetLicense();
}
function SetLicense()
{
var url = '@Url.Action("GetLicense", "EmpDoc")';$.post(url, $('form').serialize(), function (view) {$("#TxtClaim").val(view.Claim);// The value TxtClaim should be updated from GetLicense. But not working
});
}
</script
public IActionResult GetLicense(EmpDocumentModel data) { EmpDocumentModel doc = new EmpDocumentModel(); data.Claim = "TestClaim"; // This value should be updated in my html view return Json(data); }