in Education by
When I select value in select2 multiple selection, the default 0 value is still there in the list. Any ideas how to remove it? div class="row mg-t-20"> @Html.LabelFor(m => m.ActivityThatIsAssigned, new { @class = "col-sm-4 form-control-label" })
@Html.DropDownListFor(m => m.ActivityThatIsAassignedId, Model.ActivityThatIsAssigned, new { @class = "dropdown js-ActivityThatIsNotAssigned-dropdown", @multiple = "multiple", @style = "width: 100%;" }) @Html.HiddenFor(m => m.ActivityThatIsAassignedId)
model item [Display(Name = "Activity that is assigned")] public IEnumerable ActivityThatIsAssigned { get; set; } Init select2 $(".dropdown").select2({ width: '100%' }); $(".js-selectlinkedinprofile, .js-selectbatch, .js-selecttag, .js-selectfanactivity, .js-selectfandeliveryaction, .js-ConnectedToOtherProfiles").prepend(''); $(".dropdown.js-selectfandeliveryaction, .dropdown.js-selectlinkedinprofile, .dropdown.js-selectbatch, .dropdown.js-selecttag, .dropdown.js-selectfanactivity, .dropdown.js-selectfandeliveryaction, .dropdown.js-ActivityThatIsAssigned-dropdown, .dropdown.js-ActivityThatIsNotAssigned-dropdown, .dropdown.js-ConnectedToOtherProfiles" ).select2(); $(".js-selectlinkedinprofile, .js-selectbatch, .js-selecttag, .js-selectfandeliveryaction,.js-ConnectedToOtherProfiles").val("0").trigger("change.select2"); JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I think you can just remove it by yourself on the server side (controller). Loop ActivityThatIsAssignedId list, if equals to zero just remove it from the list.

Related questions

0 votes
    We create new sites in IIS 6 (Windows Server 2003) using IIS Manager. When these sites are created ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 27, 2022 in Education by JackTerrance
0 votes
    I am developing a .NET core application with Identity login which provides a Bootstrap form In the /Identity ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 23, 2022 in Education by JackTerrance
0 votes
    This is our setup: Windows 2003 Server Standard, SQL 2005 and ASP.NET 4.0. We have a news site ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    I have a viewmodel with an Id property [Required] public int Id { get; set; } But I think this ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 27, 2022 in Education by JackTerrance
0 votes
    I have a viewmodel with an Id property [Required] public int Id { get; set; } But I think this ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 27, 2022 in Education by JackTerrance
0 votes
    I have converted a few DropDownLists to jQuery comboboxes to add auto complete functionality etc. however, there ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    I have converted a few DropDownLists to jQuery comboboxes to add auto complete functionality etc. however, there ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    I created a brand new Web Application, .NET Full Framework 4.7.2, added Application Insights Snapshot ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 22, 2022 in Education by JackTerrance
0 votes
    Details: We are using Keycloak authentication server with Asp.Net WebAPI. Now I need to get the Keycloak ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    I have user control named DateTimeUC which has two textboxes on its markup: I am dynamically creating this ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 13, 2022 in Education by JackTerrance
0 votes
    I have user control named DateTimeUC which has two textboxes on its markup: I am dynamically creating this ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 13, 2022 in Education by JackTerrance
0 votes
    I have user control named DateTimeUC which has two textboxes on its markup: I am dynamically creating this ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 13, 2022 in Education by JackTerrance
0 votes
    I'm working with ASP.NET 3.5. I have a list box that users must add items to (I've written ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 12, 2022 in Education by JackTerrance
0 votes
    I have a simple MVC3 Controller Action like this [HttpGet] [OutputCache(Duration = 1200,Location=System.Web. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    I've been using Git for a while now and have recently downloaded an update only to find this warning message ... share repos with? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
...