Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6377377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:51:49+00:00 2026-05-25T01:51:49+00:00

I have a pretty simple scenario and I’m sure I’m just missing something obvious.

  • 0

I have a pretty simple scenario and I’m sure I’m just missing something obvious. I’m trying to use a ListBox to grab multiple Id’s and add them to my model, but no matter what I do, the collection is always null. Here’s the code:

The model collections:

public IEnumerable<Model.UserProfile> TravelBuddies { get; set; }
        public IEnumerable<int> SelectedTravelBuddies { get; set; }

I populate the TravelBuddies collection in my controller.

The view code:

<div class="module_content">
@if (Model.TravelBuddies.Count() > 0)
{
    @Html.ListBoxFor(m => m.SelectedTravelBuddies, new MultiSelectList(Model.TravelBuddies, "Id", "FullName"))
}
else
{
    <span>You don't currently have any travel buddies (people who were with you on this trip). Don't worry, you can add some to this trip later if you'd like.</span>
}
</div>

The select list is populated in my view. No problem there. But once I select multiple items and submit my form, the Model.SelectedTravelBuddies collection is always null. Am I missing something obvious? It’s been a long night of coding.

Update: Added Controller Code

[HttpGet]
        public ActionResult New()
        {
            Model.Trip trip = new Model.Trip();
            ITripService tripService = _container.Resolve<ITripService>();
            IUserAccountService userService = _container.Resolve<IUserAccountService>();

            int userProfileId = userService.GetUserProfile((Guid)Membership.GetUser().ProviderUserKey).Id;

            trip.TripTypes = new SelectList(tripService.GetTripTypes(), "Id", "Name");
            trip.TravelBuddies = userService.GetTravelBuddies(userProfileId);

            tripService.KillFlightLegTempStorage();

            return View(trip);
        }

        [HttpPost]
        public ActionResult New([Bind(Exclude = "TripTypes")] Model.Trip trip)
        {
            ITripService tripService = _container.Resolve<ITripService>();
            if (!ModelState.IsValid)
            {
                tripService.KillFlightLegTempStorage();
                return View(trip);
            }

            int tripId = tripService.CreateTrip(trip, (Guid)Membership.GetUser().ProviderUserKey);
            tripService.KillFlightLegTempStorage();

            return RedirectToAction("Details", "Trip", new { id = tripId });
        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:51:50+00:00Added an answer on May 25, 2026 at 1:51 am

    Ok so you are binding to SelectedTravelBuddies. When your list is rendered, what is it’s name? It’s been a long night for me too 🙂 want to make sure it matches the model. Also are you sure the list is in the form element so they are posted?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Use scenario is pretty simple: I have a desktop only application that could be
Pretty simple scenario. I have a web service that receives a byte array that
I'm trying to something pretty simple but am having headaches with it. I'm pretty
I have a pretty simple scenario using manual data operations with rad list view.
I have a pretty simple scenario. I have the following HTML: <h1>Hello</h1> <input type="button"
I have a pretty simple image switcher, which I use for manual images switcher
I have the following seemingly simple scenario, however I'm still pretty new to NHibernate.
I'm starting to use Simple.Data a bit more seriously and have the following scenario
i have pretty simple simple question (i hope so). How do i change the
I have a pretty simple ASP.NET Web Form that looks a bit like the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.