Xml.AddParsedSubObject(Object) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Notifies the server control that an element, either XML or HTML, was parsed, and adds the element to the server control's ControlCollection object.
protected:
override void AddParsedSubObject(System::Object ^ obj);
protected override void AddParsedSubObject (object obj);
override this.AddParsedSubObject : obj -> unit
Protected Overrides Sub AddParsedSubObject (obj As Object)
Parameters
Exceptions
obj
is not of type LiteralControl.
Examples
The following code example demonstrates how to override the AddParsedSubObject method in a custom Xml server control.
<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.CS.Controls" Assembly="Samples.AspNet.CS" %>
<%@ Page Language="C#" AutoEventWireup="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Custom Xml - AddParsedSubObject - C# Example</title>
</head>
<body>
<form id="Form1" method="post" runat="server">
<h3>Custom Xml - AddParsedSubObject - C# Example</h3>
<aspSample:CustomXmlAddParsedSubObject id="xml1" runat="server"
DocumentSource="People.xml" TransformSource="PeopleTable.xslt" />
</form>
</body>
</html>
<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.VB.Controls" Assembly="Samples.AspNet.VB" %>
<%@ Page Language="VB" AutoEventWireup="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Custom Xml - AddParsedSubObject - VB.NET Example</title>
</head>
<body>
<form id="Form1" method="post" runat="server">
<h3>Custom Xml - AddParsedSubObject - VB.NET Example</h3>
<aspSample:CustomXmlAddParsedSubObject id="xml1" runat="server"
DocumentSource="People.xml" TransformSource="PeopleTable.xslt" />
</form>
</body>
</html>
using System.Web;
using System.Security.Permissions;
namespace Samples.AspNet.CS.Controls
{
[AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal)]
public sealed class CustomXmlAddParsedSubObject : System.Web.UI.WebControls.Xml
{
protected override void AddParsedSubObject(object obj)
{
// Call the base AddParseSubObject method.
base.AddParsedSubObject(obj);
// Note: This method does not get called when transforming XML.
}
}
}
Imports System.Web
Imports System.Security.Permissions
Namespace Samples.AspNet.VB.Controls
<AspNetHostingPermission(SecurityAction.Demand, Level:=AspNetHostingPermissionLevel.Minimal)> _
Public NotInheritable Class CustomXmlAddParsedSubObject
Inherits System.Web.UI.WebControls.Xml
Protected Overrides Sub AddParsedSubObject(ByVal obj As Object)
' Call the base AddParseSubObject method.
MyBase.AddParsedSubObject(obj)
' Note: This method does not get called when transforming XML.
End Sub
End Class
End Namespace
Applies to
See also
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기