Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ruder Partap Singh 1 post 21 karma points
    Oct 06, 2020 @ 11:37
    Ruder Partap Singh
    0

    CheckBoxList value is not saving using surfaceController

    Hello All I've created a custom property of type CheckBoxLIst and added few names in it. Now im trying to save a checkboxlist value selected by user from custom form using surfaceController and contentServices.I've created a string array and passing it to content service. im able to render the value using below code

    var NameCheckboxList = Services.DataTypeService.GetDataType(1234);
                var hobbiesList = ((Umbraco.Core.PropertyEditors.ValueListConfiguration)NameCheckboxList .Configuration).Items;
    
     var joinedNames = "[\"" + string.Join("\",\"", Model.Name) + "\"]"; 
    

    and it return me a value like ["Apple","Mango,"Banana"]. and pass the joinedNames to contentServices like

      var request = Services.ContentService.Create(Model.Name, parentId, "offerLightBoxItem");
    request.SetValue("oLBName", offerLightboxModel.Name);
    

    but its storing the value System.String[] in DB Can any one help me out, how to save the checkboxlist value in DB Im very new to umbraco

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies