Click here to Skip to main content
15,922,894 members

Comments by Member 12835902 (Top 4 by date)

Member 12835902 11-Nov-16 15:26pm View    
If I add a breakpoint on
IEnumerable<int> selectedDevices = vmEdit.Devices.Where(x => x.IsChecked).Select(x => x.ID);
for the [HttpPost] Edit Action Method then all of the values that I select to enter for the first time are correct and they get added to the database fine.

If I then try to update the DevId values based on the CustId 1006 and set a breakpoint on
IEnumerable<int> selectedDevices = vmEdit.Devices.Where(x => x.IsChecked).Select(x => x.ID);
for the [HttpPost] Edit Action Method and then choose to remove the Keyboard which is value 1 in the database and then click submit it actually keeps Keyboard and remove's DevId values 3, 4 and 7.
Member 12835902 10-Nov-16 14:23pm View    
Hi P_Z,

I updated my original post and added the view source for "Edit View (Source Code) that shows CheckBoxList Values:" and "Edit View (Source Code) that shows CheckBoxList Values assigned to CustId 1006:". Please let me know if you need anything else. I appreciate your help with this post. I'm truly stuck!! I'm also submitting the values using a submit button, no Ajax is being used.
Member 12835902 10-Nov-16 14:09pm View    
Deleted
Hi P_Z,

I hope I understood correctly what you are asking for. Please see the following below:

This is the ViewSource Code when I initially load the CheckBoxList Items.

<!DOCTYPE html>


<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Edit Device(s) to Customer - WebForm












Toggle navigation




WebForm



Home
Customer
Customer Device
Contact






Edit Device(s) to Customer




Please select the Devices to assign to Mary Doe






Desktop






Laptop






Keyboard






Mouse






Headset






iPad






Power Adapter






Phone





Submit





© 2016 - WebForm















<!-- Visual Studio Browser Link -->

{"requestId":"359eef69ee5348909cbbb8b0835fbb27","requestMappingFromServer":false}


<!-- End Browser Link -->





I'm posting the values back using a submit button.
Member 12835902 10-Nov-16 10:09am View    
Hi P_Z,

I looked at the article that you sent me, it makes sense but not sure how or were to implement that in my code. Is there anyway you could help me? I hate asking for help, but I have searched Google and have tried numerous things to no prevail :(