Exemple #1
0
        public static string GetPlaceholderText(ContentPlaceHolder placeHolder)
        {
            StringBuilder stringBuilder = new StringBuilder();

            foreach (object control in placeHolder.Controls)
            {
                if (control is LiteralControl)
                {
                    if (!(((LiteralControl)control).Text.Trim(' ', '\r', '\n') == ""))
                    {
                        stringBuilder.Append(((LiteralControl)control).Text);
                    }
                }
                if (control is Literal)
                {
                    if (!(((Literal)control).Text.Trim(' ', '\r', '\n') == ""))
                    {
                        stringBuilder.Append(((Literal)control).Text);
                    }
                }
                if (control is ContentPlaceHolder)
                {
                    stringBuilder.Append(WebPlaceholderTools.GetPlaceholderText((ContentPlaceHolder)control));
                }
            }
            return(stringBuilder.ToString());
        }
Exemple #2
0
 public static bool IstPlaceholderLeer(ContentPlaceHolder placeHolder)
 {
     foreach (Control control in placeHolder.Controls)
     {
         if (control is LiteralControl)
         {
             if (((LiteralControl)placeHolder.Controls[0]).Text.Trim(' ', '\r', '\n') != "")
             {
                 return(false);
             }
         }
         else if (!(control is ContentPlaceHolder) || !WebPlaceholderTools.IstPlaceholderLeer((ContentPlaceHolder)control))
         {
             return(false);
         }
     }
     return(true);
 }