private void SaveToJson(ControlCollection control) { var fieldControl = ConvertListToJson.GetValueJsonForList(control); string json = SerializeObject.SerializeObjectByFieldControl(fieldControl); NameValueCollection appSettings = ConfigurationManager.AppSettings; string path = appSettings["PathDesignUI"] + objModules.ModuleLink; if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } File.WriteAllText(path + @"\" + objModules.ModuleNo + ".json", json); }