asp.net - jQuery UI MultiSelect Widget:-after submitting button(after postback) only last selected element is checked -


I am implementing this JQuery UI multiselect

I managed to use it in my ASP .Net page, but when I am submitting a button, the selected text only examines the final element. So how do all checked items be retained after post back . Can anyone help me?

Here I am making the data popular in the dropdown list and the main functionality is written to DAL on the data from the database. Protected Zero clearNPouplateListBox (dropdown list ctrl, DataTable DT) {try {ctrl.DataSource = dt; Ctrl.DataTextField = "name"; Ctrl.DataValueField = "Id"; Ctrl.DataBind (); } Hold (Exceptional) {Logger Type ("Exceptions in LogGeneralIncidentForm.ClearNPouplateListBox Method" pre-message); }}

Here I am trying to put the selected data in the data table

  DataTable dtAssigners = new DataTable (); DtAssigners.Columns.Add ("GIMID", typef (int)); DtAssigners.Columns.Add ("UserId", typef (int)); DtAssigners.Columns.Add ("MODE", Typef (four)); DtAssigners.Columns.Add ("created", type (int)); Datatile dt = faucet; Foreach (ddlAssignedTo.Items in the system.Web.UI.WebControls.ListItem list) {if (list.Selected) {DataRow drUsers = dtAssigners.NewRow (); Duyugers ["GIMID"] = GIMID; DrUsers ["MODE"] = 'I'; DrUsers ["UserId"] = Convert toInt32 (list.Value); DRUsers ["Created"] = CurUsr.UserId; DtAssigners.Rows.Add (drUsers); }}   

is my java script

  & lt; Script type = "text / javascript" & gt; $ (Function () {/ * Define global variable, and store message container element. * / Var warning = $ (".msg"); $ ("# ctl00_MainContent_ddlAssignedTo"). Multiselect ({Selected list: 10, Show: ["Slide", 1000], Hide: ["Slide", 1000], Header: Click "Choose Only Ten Items!": Function (e) {if ($ ("($ ctl00_MainContent_ddlAssignedTo"). Multiselect ("Input": "Error"). RemoveClass ("Success") html ("You can check only ten checkboxes!") Return Return;} Other {Warning.addClass ("Success") RemoveClass ("Error"). Html ("See some boxes ");}}}) Multiselectfilter ();}); & lt; / script & gt; If a list is using box control, make sure that you include the SelectionMode attribute and set it to multiple .    

. I sat on this issue and he made it right for me down Your exact code snippet will be attached.

aspx page:

   list: id = "ddlregion" runat = "server" SelectionMode = "Multiple" /> & Lt; / Td> & Lt; Td> & Lt; ASP: List Box ID = "ddlZone" runat = "server" SelectionMode = "Multiple" /> & Lt; / Td> & Lt; Td> & Lt; ASP: List box id = "ddlDistrict" runat = "server" selectionMode = "multiple" /> & lt; / Td>   

jQuery: $ ('# & lt;% = ddlRegion.ClientID% & gt;') Multiselect ({none selected selected: "select field" header: wrong}} $ ('# & lt;% = ddlZone.ClientID% & gt;') Multicast ({none selected selected text: " Multilanguage ({none Selected Selected Text: "Select District", Header: Incorrect});