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 6628243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:06:28+00:00 2026-05-25T22:06:28+00:00

Looked and found solutions with broken links or that did not work for me,

  • 0

Looked and found solutions with broken links or that did not work for me, that said I am using the multiselect found here http://abeautifulsite.net/blog/2008/04/jquery-multiselect/ I need to get the selected checkboxes when I hit a button to use them in c#, I am totally stuck on this one and the example used in the demo that does it is in php 🙁

JQuery:

  $(document).ready(function () {
        $("#EGM").multiSelect({ selectAll: false, oneOrMoreSelected: '*' });
    });

Control:

 <select id="EGM" multiple="multiple" style="width: 100px;">
        <optgroup label="EGM">
         <option>data</option>           
        <option>driven</option>           
        <option>dropdown</option>      
        </optgroup>
        <optgroup  label="System Type">SystemType
         <option>data</option>          
         <option>driven</option>           
         <option>dropdown</option>          
         </optgroup>            
         </select>

Where I need my selected values in the code behind:

  protected void SubmitButton_Click(object sender, EventArgs e)
{

     //what goes here?!?

}
  • 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-25T22:06:29+00:00Added an answer on May 25, 2026 at 10:06 pm

    The proper way to do this would be to change <select ...> to <asp:ListBox ...> and update your script to

    $(document).ready(function() {
        $('#<%=this.EGM.ClientID%>').multiSelect(...);
    });
    

    But the <asp:ListBox> control doesn’t natively support optgroup inner elements. There are workarounds using ControlAdapters (see: Dropdownlist control with <optgroup>s for asp.net (webforms)? – VB.NET). Using this, you can access the ListItems directly.

    That said, a less proper yet less time consuming way, you could also just dump $('#EGM').val() into an <asp:HiddenField> by specifying a callback method in the multiSelect initializer and enumerate the array in the code behind.

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

Sidebar

Related Questions

I have looked all around and only found solutions for python 2.6 and earlier,
I looked around and found that there is an onerror function for flexigrid but
In my table I have looked manually and found that the top three idle
I have looked on FaceBook Developer page and found that it's possible to create
I just looked back through the project that nearly finished recently and found a
I've looked at free javascript html editors, and I haven't found any that I
Python beginner here. I've looked around and found similar questions but can't quite cobble
I have looked around and found a couple of solutions for back button support
I've looked and found several similar questions but can't seem to make the solutions
I've found a couple of posts suggesting proprietary solutions that do what I'm looking

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.