ControlBuilder.AppendLiteralString(String) 方法

定义

将指定的文本内容添加到控件。Adds the specified literal content to a control. 此方法由 ASP.NET 页面框架调用。This method is called by the ASP.NET page framework.

public:
 virtual void AppendLiteralString(System::String ^ s);
public virtual void AppendLiteralString (string s);
abstract member AppendLiteralString : string -> unit
override this.AppendLiteralString : string -> unit
Public Overridable Sub AppendLiteralString (s As String)

参数

s
String

要添加到控件的内容。The content to add to the control.

例外

字符串的格式不正确。The string literal is not well formed.

示例

// Override the AppendLiteralString method so that literal
// text between rows of controls are ignored.  
public override void AppendLiteralString(string s) 
{
  // Ignores literals between rows.
}
  ' Override the AppendLiteralString method so that literal
  ' text between rows of controls are ignored.  
  Public Overrides Sub AppendLiteralString(s As String)
  End Sub
End Class

注解

重写 AppendLiteralString 方法,以控制如何处理控件的开始标记和结束标记之间的文本内容。Override the AppendLiteralString method to control how literal content between the control's opening and closing tags is processed. 文本内容可以是浏览器向服务器控件传递的任何文本。Literal content can be any text that is passed by the browser to the server control. 例如,在其开始和结束标记之间的任何 HTML 元素和文本都是文本内容。For example, any HTML elements and text, between their opening and closing tags, are literal content.

适用于