This documentation is archived and is not being maintained.

HtmlTextWriter.EqualsChar Field

Represents the equal sign (=) character.

[Visual Basic]
Public Const EqualsChar As Char
[C#]
public const char EqualsChar;
[C++]
public: const __wchar_t EqualsChar;
[JScript]
public var EqualsChar : Char;

Example

[Visual Basic] 
Public Class FirstControl
   Inherits WebControl

   'The message property.
   Private myMessage As String = "Hello"
   
   'Accessors for the message property.
   
   Public Overridable Property Message() As String
      Get
         Return myMessage
      End Get
      Set(ByVal Value As String)
         myMessage = Value
      End Set
   End Property


   Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)
      'Output the 'font' html tag.
      'Output the '<' char.
      writer.Write(HtmlTextWriter.TagLeftChar)
      'Output the 'font' string.
      writer.Write("font")
      'Output the space char.
      writer.Write(HtmlTextWriter.SpaceChar)
      'Output the "color" string which is an attribute of font tag.
      writer.Write("color")
      'Output the equals char.
      writer.Write(HtmlTextWriter.EqualsChar)
      'Output the double quote char.
      writer.Write(HtmlTextWriter.DoubleQuoteChar)
      'Output the attribute value for the "color" attribute.
      writer.Write("blue")
      'Output the double quote char.
      writer.Write(HtmlTextWriter.DoubleQuoteChar)
      'Output the '>' char.
      writer.Write(HtmlTextWriter.TagRightChar)
      'Output the 'Message' property and the time on the server.
      writer.Write((Message + "<br>" + "The time on the server: " + System.DateTime.Now.ToLongTimeString()))
      'Output the end of 'font' tag.
      writer.WriteEndTag("font")
   End Sub 'Render 
End Class 'FirstControl 

[C#] 
public class FirstControl : WebControl
{
    // The message property.
    private String message = "Hello";

    // Accessors for the message property.
    public virtual String Message 
    {
        get {
            return message;
        }
        set {
            message = value;
        }
    }

    protected override void Render(HtmlTextWriter writer) 
    {
        // Output the 'font' html tag.
        // Output the '<' char.
        writer.Write(HtmlTextWriter.TagLeftChar);
        // Output the 'font' string.
        writer.Write("font");
        // Output the space char.
        writer.Write(HtmlTextWriter.SpaceChar);
        // Output the "color" string which is an attribute of font tag.
        writer.Write("color");
        // Output the equals char.
        writer.Write(HtmlTextWriter.EqualsChar);
        // Output the double quote char.
        writer.Write(HtmlTextWriter.DoubleQuoteChar);
        // Output the attribute value for the "color" attribute.
        writer.Write("red");
        // Output the double quote char.
        writer.Write(HtmlTextWriter.DoubleQuoteChar);
        // Output the '>' char.
        writer.Write(HtmlTextWriter.TagRightChar);
        // Output the 'Message' property and the time on the server.
        writer.Write(Message + "<br>" +
                     "The date on the server: " +
                     System.DateTime.Now.ToLongTimeString());
        // Output the end of 'font' tag.
        writer.WriteEndTag("font");
    }
}

[C++] 
public __gc class FirstControl : public WebControl
{
   // The message property.
private:
   String* message;

   // Accessors for the message property.
public:
   __property virtual String* get_Message() {
      return message;
   }
   __property virtual void set_Message( String* value ) {
      message = value;
   }

protected:
   void Render(HtmlTextWriter* writer) 
   {
      // Output the 'font' html tag.
      // Output the '<' char.
      writer->Write(HtmlTextWriter::TagLeftChar);
      // Output the 'font' string.
      writer->Write(S"font");
      // Output the space char.
      writer->Write(HtmlTextWriter::SpaceChar);
      // Output the "color" string which is an attribute of font tag.
      writer->Write(S"color");
      // Output the equals char.
      writer->Write(HtmlTextWriter::EqualsChar);
      // Output the double quote char.
      writer->Write(HtmlTextWriter::DoubleQuoteChar);
      // Output the attribute value for the "color" attribute.
      writer->Write(S"red");
      // Output the double quote char.
      writer->Write(HtmlTextWriter::DoubleQuoteChar);
      // Output the '>' char.
      writer->Write(HtmlTextWriter::TagRightChar);
      // Output the 'Message' property and the time on the server.
      writer->Write(String::Concat( Message, S"<br>", S"The date on the server: ", System::DateTime::Now.ToLongTimeString() ));
      // Output the end of 'font' tag.
      writer->WriteEndTag(S"font");
   }
};

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

HtmlTextWriter Class | HtmlTextWriter Members | System.Web.UI Namespace

Show: