HtmlTextWriter.SlashChar Pole

Definicja

Reprezentuje znak ukośnika (/).

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

Wartość pola

Przykłady

W poniższym przykładzie kodu pokazano, jak ręcznie renderować src atrybut elementu <img> . W przykładzie kodu użyto Write metody z polem jako parametru SlashChar do renderowania ukośnika w ścieżce, która jest stosowana do atrybutu src .

Ten przykład kodu renderuje następujące znaczniki:

src="/images/

// Write the src attribute and the path
// for the image file.
writer.Write("src");
writer.Write(HtmlTextWriter.EqualsChar);
writer.Write(HtmlTextWriter.DoubleQuoteChar);
writer.Write(HtmlTextWriter.SlashChar);
writer.Write("images");
writer.Write(HtmlTextWriter.SlashChar);
' Write the src attribute and the path
' for the image file.
writer.Write("src")
writer.Write(HtmlTextWriter.EqualsChar)
writer.Write(HtmlTextWriter.DoubleQuoteChar)
writer.Write(HtmlTextWriter.SlashChar)
writer.Write("images")
writer.Write(HtmlTextWriter.SlashChar)

Uwagi

SlashChar Użyj pola, aby renderować znaczniki ukośnika podczas pisania adresu URL. Metoda WriteEndTag używa pola podczas zapisywania tagu SlashChar zamykającego elementu znaczników.

Dotyczy

Zobacz też