How to do a Multi-Select List Box program

User Generated

xvzoreyrl

Programming

Description

Hi, 

I have "get" method in my controller which features a multi select list box that takes multiple selections from a user. I have a similar "post" method that returns the results of these selections. At the moment however, the "post" method is only returning the results from one selection when more than one value as been selected. In this instance, more than one value's results should be returned. Would someone mind taking a look at my "post" method to see what is going wrong? Thankyou. 

Price is negotiable. 



        [HttpPost]

        public ActionResult Find(FindViewModel viewModel)

        {

            viewModel.PersonViewModel = new PersonViewModel

                                                {

                                                    Organisations =

                                                        new MultiSelectList(

                                                        this.personManager

                                                        .GetAllPeople(), 

                                                        "Id", 

                                                        "Name"), 

                                                };

            if (!this.ModelState.IsValid)

            {

                return this.View(viewModel);

            }

            viewModel.SearchResult = this.petManager.FindPets(viewModel.SearchCriteria, int.Parse(Session["LoginId"].ToString()));

            return this.View(viewModel);

        }


I am looking for a reasonable answer, no essays, and high English proficiency preferred.


User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer


Anonymous
Great! Studypool always delivers quality work.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags