HtmlTextArea.AddParsedSubObject Method

This method supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Notifies the HtmlTextArea control that an object was parsed and adds the object to the HtmlTextArea control's ControlCollection object.

Namespace: System.Web.UI.HtmlControls
Assembly: System.Web (in system.web.dll)

protected:
virtual void AddParsedSubObject (
	Object^ obj
) override
protected void AddParsedSubObject (
	Object obj
)
protected override function AddParsedSubObject (
	obj : Object
)

Parameters

obj

An Object that represents the parsed element.

Exception typeCondition

HttpException

The object specified by the obj parameter can only be of the type LiteralControl or DataBoundLiteralControl.

The AddParsedSubObject method adds an object to the HtmlTextArea control's ControlCollection if the object is of the type LiteralControl or DataBoundLiteralControl; otherwise, an HttpException is thrown.

The AddParsedSubObject method is primarily used by control developers extending the functionality of the HtmlTextArea control.

The following code example demonstrates how to override the AddParsedSubObject method in a custom HtmlTextArea server control so that it always determines whether the parsed object is of the type LiteralControl or DataBoundLiteralControl.

No code example is currently available or this language may not be supported.
<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.JSl.Controls" Assembly="Samples.AspNet.JSL" %>
<%@ Page Language="VJ#" AutoEventWireup="True" %>
<HTML>
	<HEAD>
		<title>Custom HtmlTextArea - AddParsedSubObject - VJ# Example</title>
    <script runat="server">
    void Page_Load(Object sender, EventArgs e) 
    {
        HtmlTextArea1.set_Value("Hello Html Text Area World.");
    } //Page_Load
    </script>
	</HEAD>
	<body>
		<form id="Form1" method="post" runat="server">
			<h3>Custom HtmlTextArea - AddParsedSubObject - VJ# Example</h3>

      <aspSample:CustomHtmlTextAreaAddParsedSubObject 
        id="HtmlTextArea1" 
        name="HtmlTextArea1" 
        runat="server" 
        rows="4" 
        cols="50" />
        
		</form>
	</body>
</HTML>

No code example is currently available or this language may not be supported.
package Samples.AspNet.JSL.Controls;

public class CustomHtmlTextAreaAddParsedSubObject
   extends System.Web.UI.HtmlControls.HtmlTextArea
{
    protected void AddParsedSubObject(Object obj)
        throws System.Web.HttpException
    {
        // If the object is a LiteralControl or a DataBoundLiteralControl  
        // control, then pass the object to the base's AddParsedSubObject method.
        if (obj instanceof System.Web.UI.LiteralControl 
            || obj instanceof System.Web.UI.DataBoundLiteralControl) {
            super.AddParsedSubObject(obj);
        }
        else {
            throw new System.Web.
                HttpException("You cannot have a child control of type " 
                + obj.GetType().get_Name().ToString());
        }
    } //AddParsedSubObject
} //CustomHtmlTextAreaAddParsedSubObject

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

ADD
Show: