NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

HtmlContainerControl.InnerText

Gets or sets all text between the opening and closing tags of the specified HTML server control.

[Visual Basic]
Overridable Public Property InnerText As String
[C#]
public string InnerText {virtual get; virtual set;}
[C++]
public: __property virtual String* get_InnerText();
public: __property virtual void set_InnerText(String*);
[JScript]
public function get InnerText() : String;
public function set InnerText(String);

Property Value

The text between opening and closing tags of an HTML server control.

Exceptions

Exception Type Condition
HttpException There is no HTML Server control to get the content from.

-or-

There is more than one HTML Server control.

-or-

The HTML Server control is not a literal control.

Remarks

Unlike the InnerHtml property, InnerText provides automatic HTML encoding and decoding.

Example [C#]

This example demonstrates the HTML encoding service available through this property.

[C#]

<html>
   <script language="C#" runat=server>

       void Page_Load(Object Src, EventArgs E) {
         Message.InnerText = "<b>Welcome!</b>" ;
       }

   </script>

   <body>
      <font id="MessageFont" size="14" runat=server>
         <span id="Message" runat=server></span>
      </font>
   </body>
</html>

See Also

HtmlContainerControl Class | HtmlContainerControl Members | System.Web.UI.HtmlControls Namespace