MultiSelectListBox posting back selected items

Posted by: martinrwilliams on 13 November 2025, 11:55 pm EST

    • Post Options:
    • Link

    Posted 13 November 2025, 11:55 pm EST

    Can someone please explain the definitive way/answer as to how to get selected item Ids back through the model in APS.Net Core ?

    I can populate the listbox no problem, but just cannot get any visibility of selected items on postback ?

  • Posted 14 November 2025, 9:09 am EST

    Hello,

    The simplest and most reliable way to handle this is to add a hidden input to your form and keep it in sync with whatever the user selects. Once the form is submitted, you can read that hidden field in your controller and parse the selected values normally.

    You can refer to our MvcExplorer Product Sample located at ‘.\Documents\ComponentOne Samples\ASP.NET MVC Core\CS\MvcExplorer’ on your machine if you have downloaded the sample while installing the C1 Web Suite using ComponentOneControlPanel.

    For convenience, we’ve also created a small working sample project that shows this end-to-end.

    You can refer to MultiSelect_PostBack.zip for the complete implementation.

    Regards,

    Uttkarsh.

  • Posted 15 November 2025, 9:01 am EST

    Yeah, I can get the selected items now … but how do I get their key ID ?

  • Posted 17 November 2025, 5:51 am EST

    Hello,

    You can update the model based on your requirements and send the IDs instead of the names during postback. Please refer to the updated sample for the same.

    Sample: MultiSelect_PostBack_Mod.zip

    Regards,

    Uttkarsh.

  • Posted 3 December 2025, 7:19 am EST

    Thank You

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels