System.Web.UI.ControlBuilder.AppendLiteralString C# (CSharp) Method

AppendLiteralString() public method

public AppendLiteralString ( string s ) : void
s string
return void
		public virtual void AppendLiteralString (string s)
		{
			if (s == null || s.Length == 0)
				return;

			if (childrenAsProperties || !isIParserAccessor) {
				if (defaultPropertyBuilder != null) {
					defaultPropertyBuilder.AppendLiteralString (s);
				} else if (s.Trim ().Length != 0) {
					throw new HttpException (String.Format ("Literal content not allowed for '{0}' {1} \"{2}\"",
										tagName, GetType (), s));
				}

				return;
			}
			
			if (!AllowWhitespaceLiterals () && s.Trim ().Length == 0)
				return;

			if (HtmlDecodeLiterals ())
				s = HttpUtility.HtmlDecode (s);

			AddChild (s);
		}

Usage Example

Example #1
0
        public virtual void AppendLiteralString(string s)
        {
            if (s == null || s.Length == 0)
            {
                return;
            }

            if (childrenAsProperties || !isIParserAccessor)
            {
                if (defaultPropertyBuilder != null)
                {
                    defaultPropertyBuilder.AppendLiteralString(s);
                }
                else if (s.Trim().Length != 0)
                {
                    throw new HttpException(String.Format("Literal content not allowed for '{0}' {1} \"{2}\"",
                                                          tagName, GetType(), s));
                }

                return;
            }

            if (!AllowWhitespaceLiterals() && s.Trim().Length == 0)
            {
                return;
            }

            if (HtmlDecodeLiterals())
            {
                s = HttpUtility.HtmlDecode(s);
            }

            AddChild(s);
        }
All Usage Examples Of System.Web.UI.ControlBuilder::AppendLiteralString