Пример #1
0
        private void RenderPlaceholderRecomendations()
        {
            var listOfSelectedRenderings = new List <Item>();

            if (HttpContext.Current.Request.Form["__EVENTTARGET"] != null)
            {
                if (Treeview != null && HttpContext.Current.Request.Form["__EVENTTARGET"] == Treeview.ID)
                {
                    if (Treeview.SelectedIDs.Any(q => !String.IsNullOrWhiteSpace(q)))
                    {
                        var selected = Treeview.GetSelectedItems();
                        if (selected != null)
                        {
                            var selectedrendering = selected.FirstOrDefault();
                            if (selectedrendering != null)
                            {
                                listOfSelectedRenderings.Add(selectedrendering);
                            }
                        }
                    }
                }

                if (RecommendedTreeview != null && HttpContext.Current.Request.Form["__EVENTTARGET"] == RecommendedTreeview.ID)
                {
                    var rrSelected = RecommendedTreeview.GetSelectionItem();
                    if (rrSelected != null)
                    {
                        var selectedrendering = rrSelected.FirstOrDefault();
                        if (selectedrendering != null)
                        {
                            listOfSelectedRenderings.Add(selectedrendering);
                        }
                    }
                }


                if (listOfSelectedRenderings.Any())
                {
                    RenderPlaceholderRecomendations(listOfSelectedRenderings.First());
                }
                else
                {
                    RecommendedPlaceholders.InnerHtml = String.Empty;
                }
            }
        }