Marius Vasile

Marius Vasile

  • 594
  • 1.9k
  • 144.8k

how do I pass a Model value to jquery?

Aug 11 2021 4:14 PM

I want to use a Model value as jquery variable. In my case idinv and app. How do I pass it?

 

$(function () {
            $("#Member").on("change", function () {
                var categoryId = $(this).val();
                var idinv [email protected];
                var app = @Model.APP;
                var msg = "";
                $.getJSON(`?handler=CheckUserName&id=${categoryId}&idinv=${idinv}&app=${app}`, (data) => {
                    if (data == true) {
                        $("#btnSubmit").attr("disabled", true);
                        msg = msg + categoryId + " " + "is already member of Investigation Team";
                    }
                    else {
                        $("#btnSubmit").attr("disabled", false);
                    }
                    $("#msgUN").text(msg);
                });
            });
        });

 


Answers (1)