3

when i use this code as script i get this error in console :

Syntax Error: missing variable name

$(document).ready(function () {
        var multiselect = $("#TahiyeKonande").data("kendoMultiSelect");
        var arr = [];
        var t = @ttt;
        var tt = t.split(",");
        console.log(tt);
        // set the value of the multiselect.
        console.log(arr);
        multiselect.value(arr);
    });
2

1 Answer 1

4

for convert razor viewbag string to js use double quotation

$(document).ready(function () {
        var multiselect = $("#TahiyeKonande").data("kendoMultiSelect");
        var arr = [];
        var t = "@ttt";
        var tt = t.split(",");
        console.log(tt);
        // set the value of the multiselect.
        console.log(arr);
        multiselect.value(arr);
    });
Sign up to request clarification or add additional context in comments.

1 Comment

tanks bro it worked

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.