Relative Content

Tag Archive for javascriptjqueryasp.net-core-mvcjquery-select2

JQuery Select2 dropdown not able to set the text in MVC

I am using the select2 jquery plugin. I was unable to set/assign the text to the select control. I used select2 with trigger function for setting the value. Firstly the control which I have taken is helper class dropdown @Html.DropDownList in MVC. I am getting the error like Cannot read properties of undefined (reading ‘text’). My code is like as follows :

JQuery Select2 dropdown not able to set the text in MVC

I am using the select2 jquery plugin. I was unable to set/assign the text to the select control. I used select2 with trigger function for setting the value. Firstly the control which I have taken is helper class dropdown @Html.DropDownList in MVC. I am getting the error like Cannot read properties of undefined (reading ‘text’). My code is like as follows :