HtmlTextWriter.SemicolonChar HtmlTextWriter.SemicolonChar HtmlTextWriter.SemicolonChar HtmlTextWriter.SemicolonChar Field

定義

表示分號 (;)。Represents the semicolon (;).

public: char SemicolonChar;
public const char SemicolonChar;
val mutable SemicolonChar : char
Public Const SemicolonChar As Char 

欄位值

範例

下列程式碼範例示範如何在標記元素上手動呈現一系列的樣式。The following code example demonstrates how to manually render a series of styles on a markup element. 此程式碼範例會Write使用方法來font-size呈現border-style和樣式屬性。The code example uses the Write method to render font-size and border-style style attributes. 欄位是用來做為Write方法的參數,用來font-size分隔屬性的值與border-style屬性的開頭。 SemicolonCharThe SemicolonChar field is used as a parameter of the Write method to separate the value of the font-size attribute from the beginning of the border-style attribute.

這個程式碼範例會呈現下列標記:This code example renders the following markup:

style="font-size:12pt;border-style:ridge"

// Create some styles for the button.
writer.Write(HtmlTextWriter.SpaceChar);
writer.Write("style");
writer.Write(HtmlTextWriter.EqualsDoubleQuoteString);
writer.Write("font-size");
writer.Write(HtmlTextWriter.StyleEqualsChar);
writer.Write("12pt");
writer.Write(HtmlTextWriter.SemicolonChar);
writer.Write("border-style");
writer.Write(HtmlTextWriter.StyleEqualsChar);
writer.Write("ridge");
writer.Write(HtmlTextWriter.DoubleQuoteChar);
' Create some styles for the button.
writer.Write(HtmlTextWriter.SpaceChar)
writer.Write("style")
writer.Write(HtmlTextWriter.EqualsDoubleQuoteString)
writer.Write("font-size")
writer.Write(HtmlTextWriter.StyleEqualsChar)
writer.Write("12pt")
writer.Write(HtmlTextWriter.SemicolonChar)
writer.Write("border-style")
writer.Write(HtmlTextWriter.StyleEqualsChar)
writer.Write("ridge")
writer.Write(HtmlTextWriter.DoubleQuoteChar)

備註

當您想要從自訂控制項或Write介面卡呈現分號時,請將欄位當做方法呼叫中的參數引數傳遞。SemicolonCharPass the SemicolonChar field as the parameter argument in a Write method call when you want to render a semicolon from a custom control or adapter.

適用於

另請參閱