public ActionResult BackGroundStyling(int widgetid)
        {
            //get style

            var item = _contentManager.Get<CustomStyle>(widgetid);

            if (item != null)
            {

                string css = item.CssStyle;


                if (string.IsNullOrWhiteSpace(css)) css = string.Empty;
 

                //parse
                //strip out the px symbol
                css = css.Replace("px", "");
                var col = ParseStringTocssCollection(css);
                ViewBag.widgetid = widgetid;


                var mdl = new StandardSettings();
                if (col.ContainsKey("background-color")) mdl.BackGroundColor =col["background-color"];
                
     

                return PartialView(mdl);


            }


            return null;
        }
        public JsonResult SaveBackGroundStyling(int widgetidbackground, StandardSettings mdl)
        {

            if (ModelState.IsValid)
            {
                var item = _contentManager.Get<CustomStyle>(widgetidbackground);
                if (item != null)
                {
                    string css = item.CssStyle;
                    if (string.IsNullOrWhiteSpace(css)) css = string.Empty;
                    //parse
                    var col = ParseStringTocssCollection(css);
                    //clear any previous instanses
                    if (col.ContainsKey("background-color")) col.Remove("background-color");
                    // add css styles from model
                    col.Add("background-color", mdl.BackGroundColor);


                    //serialize back 
                    item.CssStyle = CssCollectionTostring(col);


                    _repo.Update(item.Record);

                    return Json(new { s = "Saved settings!" });
                }
            }
            else
            {
                //model state is not valid
                return Json(new { s = PrepareErrMsg(ModelState) });

            }
 
            return null;
        }