HtmlTextWriter.SlashChar Fält

Definition

Representerar snedstrecket (/).

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

Fältvärde

Exempel

Följande kodexempel visar hur du manuellt renderar attributet för src ett <img> element. Kodexemplet använder Write metoden med SlashChar fältet som parameter för att återge snedstreck i sökvägen som tillämpas på src attributet.

I det här kodexemplet återges följande markering:

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)

Kommentarer

Använd fältet SlashChar för att återge snedstrecken när du skriver en URL. Metoden WriteEndTag använder fältet SlashChar när du skriver den avslutande taggen för ett markeringselement.

Gäller för

Se även