XmlDataSource Classe
Definição
Representa uma fonte de dados XML para controles ligados a dados.Represents an XML data source to data-bound controls.
public ref class XmlDataSource : System::Web::UI::HierarchicalDataSourceControl, System::ComponentModel::IListSource, System::Web::UI::IDataSource
[System.Drawing.ToolboxBitmap(typeof(System.Web.UI.WebControls.XmlDataSource))]
public class XmlDataSource : System.Web.UI.HierarchicalDataSourceControl, System.ComponentModel.IListSource, System.Web.UI.IDataSource
[<System.Drawing.ToolboxBitmap(typeof(System.Web.UI.WebControls.XmlDataSource))>]
type XmlDataSource = class
inherit HierarchicalDataSourceControl
interface IDataSource
interface IListSource
Public Class XmlDataSource
Inherits HierarchicalDataSourceControl
Implements IDataSource, IListSource
- Herança
- Atributos
- Implementações
Exemplos
Esta seção contém dois exemplos de código.This section contains two code examples. O primeiro exemplo de código demonstra como usar um XmlDataSource controle com um TreeView controle para exibir dados XML do arquivo XML de exemplo.The first code example demonstrates how to use an XmlDataSource control with a TreeView control to display XML data from the sample XML file. O segundo exemplo demonstra como usar um XmlDataSource controle com um controle de modelo Repeater para exibir dados XML.The second example demonstrates how to use an XmlDataSource control with a templated Repeater control to display XML data.
O exemplo de código a seguir demonstra como usar um XmlDataSource controle com um TreeView controle para exibir dados XML.The following code example demonstrates how to use an XmlDataSource control with a TreeView control to display XML data. O XmlDataSource carrega dados XML do arquivo XML identificado pela DataFile propriedade.The XmlDataSource loads XML data from the XML file identified by the DataFile property.
<%@ Page Language="C#" %>
<!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 runat="server">
<title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<asp:xmldatasource
id="XmlDataSource1"
runat="server"
datafile="books.xml" />
<!- TreeView uses hierachical data, so the
XmlDataSource uses an XmlHierarchicalDataSourceView
when a TreeView is bound to it. -->
<asp:TreeView
id="TreeView1"
runat="server"
datasourceid="XmlDataSource1">
<databindings>
<asp:treenodebinding datamember="book" textfield="title"/>
</databindings>
</asp:TreeView>
</form>
</body>
</html>
<%@ Page Language="VB" %>
<!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 runat="server">
<title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<asp:xmldatasource
id="XmlDataSource1"
runat="server"
datafile="books.xml" />
<!- TreeView uses hierachical data, so the
XmlDataSource uses an XmlHierarchicalDataSourceView
when a TreeView is bound to it. -->
<asp:TreeView
id="TreeView1"
runat="server"
datasourceid="XmlDataSource1">
<databindings>
<asp:treenodebinding datamember="book" textfield="title"/>
</databindings>
</asp:TreeView>
</form>
</body>
</html>
O arquivo XML no exemplo de código tem os seguintes dados:The XML file in the code example has the following data:
<books>
<computerbooks>
<book title="Secrets of Silicon Valley" author="Sheryl Hunter"/>
<book title="Straight Talk About Computers" author="Dean Straight"/>
<book title="You Can Combat Computer Stress!" author="Marjorie Green"/>
</computerbooks>
<cookbooks>
<book title="Silicon Valley Gastronomic Treats" author="Innes del Castill"/>
</cookbooks>
</books>
O exemplo de código a seguir demonstra como usar um XmlDataSource controle com um controle de modelo Repeater para exibir dados XML.The following code example demonstrates how to use an XmlDataSource control with a templated Repeater control to display XML data. O Repeater controle usa uma expressão XPath de vinculação de dados para associar a itens de dados no documento XML que o XmlDataSource representa.The Repeater control uses an XPath data-binding expression to bind to data items within the XML document that the XmlDataSource represents. Para obter mais informações XPath sobre XPathSelect a sintaxe de vinculação de dados, consulte a XPathBinder classe.For more information about XPath and XPathSelect data-binding syntax, see the XPathBinder class.
<%@ Page Language="C#" %>
<!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 runat="server">
<title>Order</title>
</head>
<body>
<form id="form1" runat="server">
<asp:XmlDataSource
runat="server"
id="XmlDataSource1"
XPath="orders/order"
DataFile="order.xml" />
<asp:Repeater ID="Repeater1"
runat="server"
DataSourceID="XmlDataSource1">
<ItemTemplate>
<h2>Order</h2>
<table>
<tr>
<td>Customer</td>
<td><%#XPath("customer/@id")%></td>
<td><%#XPath("customername/firstn")%></td>
<td><%#XPath("customername/lastn")%></td>
</tr>
<tr>
<td>Ship To</td>
<td><%#XPath("shipaddress/address1")%></font></td>
<td><%#XPath("shipaddress/city")%></td>
<td><%#XPath("shipaddress/state")%>,
<%#XPath("shipaddress/zip")%></td>
</tr>
</table>
<h3>Order Summary</h3>
<asp:Repeater ID="Repeater2"
DataSource='<%#XPathSelect("summary/item")%>'
runat="server">
<ItemTemplate>
<b><%#XPath("@dept")%></b> -
<%#XPath(".")%><br />
</ItemTemplate>
</asp:Repeater>
<hr />
</ItemTemplate>
</asp:Repeater>
</form>
</body>
</html>
<%@ Page Language="VB" %>
<!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 runat="server">
<title>Order</title>
</head>
<body>
<form id="form1" runat="server">
<asp:XmlDataSource
runat="server"
id="XmlDataSource1"
XPath="orders/order"
DataFile="order.xml" />
<asp:Repeater ID="Repeater1"
runat="server"
DataSourceID="XmlDataSource1">
<ItemTemplate>
<h2>Order</h2>
<table>
<tr>
<td>Customer</td>
<td><%#XPath("customer/@id")%></td>
<td><%#XPath("customername/firstn")%></td>
<td><%#XPath("customername/lastn")%></td>
</tr>
<tr>
<td>Ship To</td>
<td><%#XPath("shipaddress/address1")%></font></td>
<td><%#XPath("shipaddress/city")%></td>
<td><%#XPath("shipaddress/state")%>,
<%#XPath("shipaddress/zip")%></td>
</tr>
</table>
<h3>Order Summary</h3>
<asp:Repeater ID="Repeater2"
DataSource='<%#XPathSelect("summary/item")%>'
runat="server">
<ItemTemplate>
<b><%#XPath("@dept")%></b> -
<%#XPath(".")%><br />
</ItemTemplate>
</asp:Repeater>
<hr />
</ItemTemplate>
</asp:Repeater>
</form>
</body>
</html>
O arquivo XML no exemplo de código tem os seguintes dados:The XML file in the code example has the following data:
<?xml version="1.0" encoding="iso-8859-1"?>
<orders>
<order>
<customer id="12345" />
<customername>
<firstn>John</firstn>
<lastn>Smith</lastn>
</customername>
<transaction id="12345" />
<shipaddress>
<address1>1234 Tenth Avenue</address1>
<city>Bellevue</city>
<state>Washington</state>
<zip>98001</zip>
</shipaddress>
<summary>
<item dept="tools">screwdriver</item>
<item dept="tools">hammer</item>
<item dept="plumbing">fixture</item>
</summary>
</order>
</orders>
Comentários
Neste tópico:In this topic:
Especificando um XSL TransformationSpecifying an XSL Transformation
Filtrando usando uma expressão XPathFiltering using an XPath Expression
IntroduçãoIntroduction
O XmlDataSource controle é um controle da fonte de dados que apresenta dados XML para controles vinculados a dados.The XmlDataSource control is a data source control that presents XML data to data-bound controls. O XmlDataSource controle pode ser usado por controles vinculados a dados para exibir dados hierárquicos e tabulares.The XmlDataSource control can be used by data-bound controls to display both hierarchical and tabular data. Normalmente, o XmlDataSource controle é usado para exibir dados XML hierárquicos em cenários somente leitura.The XmlDataSource control is typically used to display hierarchical XML data in read-only scenarios. Como o XmlDataSource controle estende a HierarchicalDataSourceControl classe, ele funciona com dados hierárquicos.Because the XmlDataSource control extends the HierarchicalDataSourceControl class, it works with hierarchical data. O XmlDataSource controle também implementa a IDataSource interface e funciona com dados de tabela, ou estilo de lista.The XmlDataSource control also implements the IDataSource interface and works with tabular, or list-style, data.
Observação
Para fins de segurança, nenhuma das XmlDataSource Propriedades de controle é armazenada no estado de exibição.For security purposes, none of the XmlDataSource control properties are stored in view state. Como é tecnicamente possível decodificar o conteúdo do estado de exibição no cliente, armazenar informações confidenciais sobre a estrutura de dados ou seu conteúdo pode expô-lo a uma ameaça de divulgação de informações.Since it is technically possible to decode the contents of view state on the client, storing sensitive information about the data structure or its contents could expose you to an information disclosure threat. Observe que, se você precisar armazenar informações como XPath propriedade no estado de exibição, poderá habilitar a criptografia para proteger o conteúdo definindo ViewStateEncryptionMode na @ Page diretiva.Note that if you need to store information such as XPath property in view state, you can enable encryption to protect the contents by setting ViewStateEncryptionMode on the @ Page directive.
Os desenvolvedores de páginas usam o XmlDataSource controle para exibir dados XML usando controles vinculados a dados.Page developers use the XmlDataSource control to display XML data using data-bound controls.
Fontes de dados XMLSources of XML Data
XmlDataSourceNormalmente, o carrega dados XML de um arquivo XML, que é especificado pela DataFile propriedade.The XmlDataSource typically loads XML data from an XML file, which is specified by the DataFile property. Os dados XML também podem ser armazenados diretamente pelo controle da fonte de dados no formato de cadeia de caracteres usando a Data propriedade.XML data can also be stored directly by the data source control in string form using the Data property. Se você quiser transformar os dados XML antes que eles sejam exibidos por um controle vinculado a dados, poderá fornecer uma folha de estilo XSL (linguagem de folha de estilos extensível) para a transformação.If you want to transform the XML data before it is displayed by a data-bound control, you can provide an Extensible Stylesheet Language (XSL) style sheet for the transformation. Assim como acontece com os dados XML, normalmente você carrega a folha de estilos de um arquivo, indicado pela TransformFile propriedade, mas também pode armazená-la no formato de cadeia de caracteres diretamente usando a Transform propriedade.As with the XML data, you typically load the style sheet from a file, indicated by the TransformFile property, but you can also store it in string form directly using the Transform property.
Atualizando dados XMLUpdating XML Data
O XmlDataSource controle é comumente usado em cenários de dados somente leitura em que um controle vinculado a dados exibe dados XML.The XmlDataSource control is commonly used in read-only data scenarios where a data-bound control displays XML data. No entanto, você também pode usar o XmlDataSource controle para editar dados XML.However, you can also use the XmlDataSource control to edit XML data. Para editar os dados XML, chame o GetXmlDocument método para recuperar um XmlDataDocument objeto que seja uma representação na memória dos dados XML.To edit the XML data, call the GetXmlDocument method to retrieve an XmlDataDocument object that is an in-memory representation of the XML data. Você pode usar o modelo de objeto exposto pelos XmlDataDocument XmlNode objetos e que ele contém ou usar uma expressão de filtragem XPath para manipular dados no documento.You can use the object model exposed by the XmlDataDocument and XmlNode objects it contains or use an XPath filtering expression to manipulate data in the document. Quando você tiver feito alterações na representação na memória dos dados XML, poderá salvá-las em disco chamando o Save método.When you have made changes to the in-memory representation of the XML data, you can save it to disk by calling the Save method.
Há algumas restrições para os recursos de edição do XmlDataSource controle:There are some restrictions to the editing capabilities of the XmlDataSource control:
Os dados XML devem ser carregados a partir de um arquivo XML indicado pela DataFile propriedade, não do XML embutido especificado na Data propriedade.The XML data must be loaded from an XML file that is indicated by the DataFile property, not from inline XML specified in the Data property.
Nenhuma transformação XSLT pode ser especificada nas Transform Propriedades ou TransformFile .No XSLT transformation can be specified in the Transform or TransformFile properties.
O Save método não trata operações simultâneas de salvamento por solicitações diferentes.The Save method does not handle concurrent save operations by different requests. Se mais de um usuário estiver editando um arquivo XML por meio do XmlDataSource , não haverá garantia de que todos os usuários estão operando com os mesmos dados.If more than one user is editing an XML file through the XmlDataSource, there is no guarantee that all users are operating with the same data. Também é possível que uma Save operação falhe devido a esses mesmos problemas de simultaneidade.It is also possible for a Save operation to fail due to these same concurrency issues.
Especificando um XSL TransformationSpecifying an XSL Transformation
Uma operação comum executada com dados XML está transformando-o de um conjunto de dados XML em outro.A common operation performed with XML data is transforming it from one XML data set into another. O XmlDataSource controle dá suporte a transformações XML com as Transform TransformFile Propriedades e, que especificam uma folha de estilos XSL a ser aplicada aos dados XML antes de serem passados para um controle vinculado a dados, e a TransformArgumentList propriedade, que permite que você forneça argumentos dinâmicos de folha de estilo XSLT a serem usados por uma folha de estilos XSL durante a transformação.The XmlDataSource control supports XML transformations with the Transform and TransformFile properties, which specify an XSL style sheet to apply to XML data before it is passed to a data-bound control, and the TransformArgumentList property, which enables you to supply dynamic XSLT style sheet arguments to be used by an XSL style sheet during the transformation. Se você especificar uma expressão de filtragem XPath usando a XPath propriedade, ela será aplicada depois que a transformação ocorrer.If you specify an XPath filtering expression using the XPath property, it is applied after the transformation takes place.
Observação
A XmlDataSource classe usa a classe preterida XslTransform para executar transformações XSL.The XmlDataSource class uses the deprecated XslTransform class to perform XSL transformations. Se você quiser usar recursos de folha de estilo que foram introduzidos depois que a XslTransform classe foi preterida, aplique as transformações manualmente usando a XslCompiledTransform classe.If you want to use style sheet features that were introduced after the XslTransform class was deprecated, apply the transforms manually by using the XslCompiledTransform class.
Filtrando usando uma expressão XPathFiltering using an XPath Expression
Por padrão, o XmlDataSource controle carrega todos os dados XML no arquivo XML identificado pela DataFile propriedade ou foi encontrado embutido na Data propriedade, mas você pode filtrar os dados usando uma expressão XPath.By default, the XmlDataSource control loads all the XML data in the XML file identified by the DataFile property or found inline in the Data property, but you can filter the data using an XPath expression. A XPath Propriedade dá suporte a um filtro XPath-Syntax que é aplicado depois que os dados XML são carregados e transformados.The XPath property supports an XPath-syntax filter that is applied after XML data is loaded and transformed.
CacheCaching
Para fins de desempenho, o Caching é habilitado para o XmlDataSource controle por padrão.For performance purposes, caching is enabled for the XmlDataSource control by default. Abrir e ler um arquivo XML no servidor toda vez que uma página solicitada pode reduzir o desempenho do seu aplicativo.Opening and reading an XML file on the server every time a page requested can reduce the performance of your application. O Caching permite reduzir a carga de processamento em seu servidor às custas da memória no servidor Web; na maioria dos casos, essa é uma boa desvantagem.Caching lets you reduce the processing load on your server at the expense of memory on the Web server; in most cases this is a good trade-off. O XmlDataSource armazena automaticamente os dados em cache quando a EnableCaching propriedade é definida como true , e a CacheDuration propriedade é definida como o número de segundos que o cache armazena os dados antes de o cache ser invalidado.The XmlDataSource automatically caches data when the EnableCaching property is set to true, and the CacheDuration property is set to the number of seconds that the cache stores data before the cache is invalidated. Você pode usar o CacheExpirationPolicy para ajustar ainda mais o comportamento de cache do controle da fonte de dados.You can use the CacheExpirationPolicy to further fine-tune the caching behavior of the data source control.
Recursos AdicionaisAdditional Features
A tabela a seguir lista os recursos adicionais que são suportados pelo XmlDataSource controle.The following table lists additional features that are supported by the XmlDataSource control.
| RecursoCapability | DescriçãoDescription |
|---|---|
| ClassificaçãoSorting | Sem suporte no XmlDataSource controle.Not supported by the XmlDataSource control. |
| FiltragemFiltering | A XPath propriedade pode ser usada para filtrar os dados XML usando uma expressão XPath apropriada.The XPath property can be used to filter the XML data using an appropriate XPath expression. |
| PaginamentoPaging | Sem suporte no XmlDataSource controle.Not supported by the XmlDataSource control. |
| AtualizarUpdating | Com suporte ao manipular o XmlDataDocument diretamente e, em seguida, chamar o Save método.Supported by manipulating the XmlDataDocument directly and then calling the Save method. |
| ExcluirDeleting | Com suporte ao manipular o XmlDataDocument diretamente e, em seguida, chamar o Save método.Supported by manipulating the XmlDataDocument directly and then calling the Save method. |
| InserindoInserting | Com suporte ao manipular o XmlDataDocument diretamente e, em seguida, chamar o Save método.Supported by manipulating the XmlDataDocument directly and then calling the Save method. |
| CacheCaching | Habilitado por padrão, com a CacheDuration propriedade definida como 0 (infinito) e a CacheExpirationPolicy propriedade definida como Absolute .Enabled by default, with the CacheDuration property set to 0 (infinite) and the CacheExpirationPolicy property set to Absolute. |
Objeto de exibição de dadosData View Object
Como o XmlDataSource controle dá suporte a controles vinculados a dados que exibem dados hierárquicos, bem como controles que exibem dados tabulares, o controle da fonte de dados dá suporte a vários tipos de objetos de exibição da fonte de dados em seus dados XML subjacentes.Because the XmlDataSource control supports data-bound controls that display hierarchical data as well as controls that display tabular data, the data source control supports multiple types of data source view objects on its underlying XML data. O XmlDataSource controle recupera um único XmlDataSourceView objeto nomeado quando usado com um controle vinculado a dados que exibe dados tabulares.The XmlDataSource control retrieves a single named XmlDataSourceView object when used with a data-bound control that displays tabular data. O GetViewNames método identifica essa exibição de nome único.The GetViewNames method identifies this single named view. Quando usado com um controle vinculado a dados que exibe dados hierárquicos, o XmlDataSource controle recupera um XmlHierarchicalDataSourceView para qualquer caminho hierárquico exclusivo passado para o GetHierarchicalView método.When used with a data-bound control that displays hierarchical data, the XmlDataSource control retrieves an XmlHierarchicalDataSourceView for any unique hierarchical path passed to the GetHierarchicalView method.
Sintaxe declarativaDeclarative Syntax
<asp:XmlDataSource
CacheDuration="string|Infinite"
CacheExpirationPolicy="Absolute|Sliding"
CacheKeyDependency="string"
DataFile="string"
EnableCaching="True|False"
EnableTheming="True|False"
EnableViewState="True|False"
ID="string"
OnDataBinding="DataBinding event handler"
OnDisposed="Disposed event handler"
OnInit="Init event handler"
OnLoad="Load event handler"
OnPreRender="PreRender event handler"
OnTransforming="Transforming event handler"
OnUnload="Unload event handler"
runat="server"
SkinID="string"
TransformArgumentList="string"
TransformFile="string"
Visible="True|False"
XPath="string"
>
<Data>string</Data>
<Transform>string</Transform>
</asp:XmlDataSource>
Construtores
| XmlDataSource() |
Cria uma nova instância da classe XmlDataSource.Creates a new instance of the XmlDataSource class. |
Propriedades
| Adapter |
Obtém o adaptador específico de navegador para o controle.Gets the browser-specific adapter for the control. (Herdado de Control) |
| AppRelativeTemplateSourceDirectory |
Obtém ou define o diretório virtual relativo de aplicativo do objeto Page ou UserControl que contém este controle.Gets or sets the application-relative virtual directory of the Page or UserControl object that contains this control. (Herdado de Control) |
| BindingContainer |
Obtém o controle que contém a vinculação de dados desse controle.Gets the control that contains this control's data binding. (Herdado de Control) |
| CacheDuration |
Obtém ou define o período de tempo, em segundos, em que o controle de fonte de dados armazena em cache os dados que recupera.Gets or sets the length of time, in seconds, that the data source control caches data it has retrieved. |
| CacheExpirationPolicy |
Obtém ou define a política de expiração de cache que é combinada com a duração do cache para descrever o comportamento do cache que o controle de fonte de dados usa.Gets or sets the cache expiration policy that is combined with the cache duration to describe the caching behavior of the cache that the data source control uses. |
| CacheKeyContext |
Obtém ou define o valor da chave de cache para o controle de fonte de dados do estado de exibição ou adiciona a chave de cache no estado de exibição.Gets or sets the value of the cache key for the data source control from view state, or adds the cache key to view state. |
| CacheKeyDependency |
Obtém ou define uma dependência de chave definida pelo usuário que é vinculada a todos os objetos de cache de dados criados pelo controle de fonte de dados.Gets or sets a user-defined key dependency that is linked to all data cache objects created by the data source control. Todos os objetos de cache expiram explicitamente quando a chave expira.All cache objects explicitly expire when the key expires. |
| ChildControlsCreated |
Obtém um valor que indica se os controles filho do controle de servidor foram criados.Gets a value that indicates whether the server control's child controls have been created. (Herdado de Control) |
| ClientID |
Obtém o identificador de controle de servidor gerado pelo ASP.NET.Gets the server control identifier generated by ASP.NET. (Herdado de HierarchicalDataSourceControl) |
| ClientIDMode |
Essa propriedade não é usada para controles de fonte de dados.This property is not used for data source controls. (Herdado de HierarchicalDataSourceControl) |
| ClientIDSeparator |
Obtém um valor de caractere que representa o caractere separador usado na propriedade ClientID.Gets a character value representing the separator character used in the ClientID property. (Herdado de Control) |
| Context |
Obtém o objeto HttpContext associado ao controle de servidor para a solicitação da Web atual.Gets the HttpContext object associated with the server control for the current Web request. (Herdado de Control) |
| Controls |
Obtém um objeto ControlCollection que representa os controles filho para um controle de servidor especificado na hierarquia de interface do usuário.Gets a ControlCollection object that represents the child controls for a specified server control in the UI hierarchy. (Herdado de HierarchicalDataSourceControl) |
| Data |
Obtém ou define um bloco de dados XML ao qual o controle de fonte de dados é associado.Gets or sets a block of XML data that the data source control binds to. |
| DataFile |
Especifica o nome do arquivo de um arquivo XML ao qual a fonte de dados é associada.Specifies the file name of an XML file that the data source binds to. |
| DataItemContainer |
Obtém uma referência ao contêiner de nomenclatura se o contêiner de nomenclatura implementa o IDataItemContainer.Gets a reference to the naming container if the naming container implements IDataItemContainer. (Herdado de Control) |
| DataKeysContainer |
Obtém uma referência ao contêiner de nomenclatura se o contêiner de nomenclatura implementa o IDataKeysControl.Gets a reference to the naming container if the naming container implements IDataKeysControl. (Herdado de Control) |
| DesignMode |
Obtém um valor que indica se um controle está sendo usado em uma superfície de design.Gets a value indicating whether a control is being used on a design surface. (Herdado de Control) |
| EnableCaching |
Obtém ou define um valor que indica se o controle XmlDataSource tem o cache de dados habilitado.Gets or sets a value indicating whether the XmlDataSource control has data caching enabled. |
| EnableTheming |
Obtém um valor que indica se esse controle dá suporte a temas.Gets a value indicating whether this control supports themes. (Herdado de HierarchicalDataSourceControl) |
| EnableViewState |
Obtém ou define um valor que indica se o controle de servidor persiste seu estado de exibição e o estado de exibição de quaisquer controles filho que ele contém, para o cliente solicitante.Gets or sets a value indicating whether the server control persists its view state, and the view state of any child controls it contains, to the requesting client. (Herdado de Control) |
| Events |
Obtém uma lista de delegados de manipulador de eventos para o controle.Gets a list of event handler delegates for the control. Essa propriedade é somente leitura.This property is read-only. (Herdado de Control) |
| HasChildViewState |
Obtém um valor que indica se os controles filho do controle de servidor atual têm alguma configuração de estado de exibição salva.Gets a value indicating whether the current server control's child controls have any saved view-state settings. (Herdado de Control) |
| ID |
Obtém ou define o identificador programático atribuído ao controle de servidor.Gets or sets the programmatic identifier assigned to the server control. (Herdado de Control) |
| IdSeparator |
Obtém o caractere usado para separar identificadores de controle.Gets the character used to separate control identifiers. (Herdado de Control) |
| IsChildControlStateCleared |
Obtém um valor que indica se os controles contidos dentro deste controle têm estado de controle.Gets a value indicating whether controls contained within this control have control state. (Herdado de Control) |
| IsTrackingViewState |
Obtém um valor que indica se o controle de servidor está salvando alterações no estado de exibição.Gets a value that indicates whether the server control is saving changes to its view state. (Herdado de Control) |
| IsViewStateEnabled |
Obtém um valor que indica se o estado de exibição está habilitado para esse controle.Gets a value indicating whether view state is enabled for this control. (Herdado de Control) |
| LoadViewStateByID |
Obtém um valor que indica se o controle participa do carregamento do estado de exibição por ID em vez do índice.Gets a value indicating whether the control participates in loading its view state by ID instead of index. (Herdado de Control) |
| NamingContainer |
Obtém uma referência ao contêiner de nomenclatura do controle do servidor, que cria um namespace exclusivo para diferenciar entre os controles de servidor com o mesmo valor da propriedade ID.Gets a reference to the server control's naming container, which creates a unique namespace for differentiating between server controls with the same ID property value. (Herdado de Control) |
| Page |
Obtém uma referência para a instância Page que contém o controle de servidor.Gets a reference to the Page instance that contains the server control. (Herdado de Control) |
| Parent |
Obtém uma referência ao controle pai do controle de servidor na hierarquia de controle da página.Gets a reference to the server control's parent control in the page control hierarchy. (Herdado de Control) |
| RenderingCompatibility |
Obtém um valor que especifica a versão do ASP.NET com a qual o HTML renderizado será compatível.Gets a value that specifies the ASP.NET version that rendered HTML will be compatible with. (Herdado de Control) |
| Site |
Obtém informações sobre o contêiner que hospeda o controle atual quando renderizados em uma superfície de design.Gets information about the container that hosts the current control when rendered on a design surface. (Herdado de Control) |
| SkinID |
Obtém ou define a capa a ser aplicada ao controle HierarchicalDataSourceControl.Gets or sets the skin to apply to the HierarchicalDataSourceControl control. (Herdado de HierarchicalDataSourceControl) |
| TemplateControl |
Obtém ou define uma referência ao modelo que contém este controle.Gets or sets a reference to the template that contains this control. (Herdado de Control) |
| TemplateSourceDirectory |
Obtém o diretório virtual do Page ou UserControl que contém o controle do servidor atual.Gets the virtual directory of the Page or UserControl that contains the current server control. (Herdado de Control) |
| Transform |
Obtém ou define um bloco de dados XSL (linguagem XSL) que define uma transformação XSLT a ser executada nos dados XML gerenciados pelo controle XmlDataSource.Gets or sets a block of Extensible Stylesheet Language (XSL) data that defines an XSLT transformation to be performed on the XML data managed by the XmlDataSource control. |
| TransformArgumentList |
Fornece uma lista de argumentos XSLT que são usados com a folha de estilos definida pelas propriedades Transform ou TransformFile para executar uma transformação nos dados XML.Provides a list of XSLT arguments that are used with the style sheet defined by the Transform or TransformFile properties to perform a transformation on the XML data. |
| TransformFile |
Especifica o nome do arquivo de um arquivo XSL (linguagem XSL) (.xsl) que define uma transformação XSLT a ser executada nos dados XML gerenciados pelo controle XmlDataSource.Specifies the file name of an Extensible Stylesheet Language (XSL) file (.xsl) that defines an XSLT transformation to be performed on the XML data managed by the XmlDataSource control. |
| UniqueID |
Obtém o identificador exclusivo, qualificado segundo a hierarquia, para o controle de servidor.Gets the unique, hierarchically qualified identifier for the server control. (Herdado de Control) |
| ValidateRequestMode |
Obtém ou define um valor que indica se o controle verifica a entrada do cliente do navegador para valores potencialmente perigosos.Gets or sets a value that indicates whether the control checks client input from the browser for potentially dangerous values. (Herdado de Control) |
| ViewState |
Obtém um dicionário de informações de estado que permite salvar e restaurar o estado de exibição de um controle de servidor em várias solicitações para a mesma página.Gets a dictionary of state information that allows you to save and restore the view state of a server control across multiple requests for the same page. (Herdado de Control) |
| ViewStateIgnoresCase |
Obtém um valor que indica se o objeto StateBag não diferencia maiúsculas de minúsculas.Gets a value that indicates whether the StateBag object is case-insensitive. (Herdado de Control) |
| ViewStateMode |
Obtém ou define o modo de estado de exibição deste controle.Gets or sets the view-state mode of this control. (Herdado de Control) |
| Visible |
Obtém ou define um valor indicando se o controle é exibido visualmente.Gets or sets a value indicating whether the control is visually displayed. (Herdado de HierarchicalDataSourceControl) |
| XPath |
Especifica uma expressão XPath a ser aplicada aos dados XML contidos na propriedade Data ou pelo arquivo XML indicado pela propriedade DataFile.Specifies an XPath expression to be applied to the XML data contained by the Data property or by the XML file indicated by the DataFile property. |
Métodos
| AddedControl(Control, Int32) |
Chamado após um controle filho ser adicionado à coleção Controls do objeto Control.Called after a child control is added to the Controls collection of the Control object. (Herdado de Control) |
| AddParsedSubObject(Object) |
Notifica o controle de servidor de que um elemento, XML ou HTML, foi analisado e adiciona o elemento ao objeto ControlCollection do controle de servidor.Notifies the server control that an element, either XML or HTML, was parsed, and adds the element to the server control's ControlCollection object. (Herdado de Control) |
| ApplyStyleSheetSkin(Page) |
Aplica as propriedades de estilo definidas na folha de estilos da página ao controle.Applies the style properties that are defined in the page style sheet to the control. (Herdado de HierarchicalDataSourceControl) |
| BeginRenderTracing(TextWriter, Object) |
Inicia o rastreamento de tempo de design de dados de renderização.Begins design-time tracing of rendering data. (Herdado de Control) |
| BuildProfileTree(String, Boolean) |
Reúne informações sobre o controle de servidor e as envia para a propriedade Trace para serem exibidas quando o rastreamento está habilitado para a página.Gathers information about the server control and delivers it to the Trace property to be displayed when tracing is enabled for the page. (Herdado de Control) |
| ClearCachedClientID() |
Define o valor ClientID armazenado em cache como |
| ClearChildControlState() |
Exclui as informações de estado de controle para os controles filho do controle de servidor.Deletes the control-state information for the server control's child controls. (Herdado de Control) |
| ClearChildState() |
Exclui as informações de estado de exibição e de estado de controle para todos os controles filho do controle de servidor.Deletes the view-state and control-state information for all the server control's child controls. (Herdado de Control) |
| ClearChildViewState() |
Exclui as informações de estado de exibição para todos os controles filho do controle de servidor.Deletes the view-state information for all the server control's child controls. (Herdado de Control) |
| ClearEffectiveClientIDMode() |
Define a propriedade ClientIDMode da instância de controle atual e de quaisquer controles filho para Inherit.Sets the ClientIDMode property of the current control instance and of any child controls to Inherit. (Herdado de Control) |
| CreateChildControls() |
Chamado pela estrutura de página do ASP.NET para notificar os controles do servidor que usam a implementação baseada em composição para criar os controles filho para preparar-se para um postback ou renderização.Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering. (Herdado de Control) |
| CreateControlCollection() |
Cria um novo objeto ControlCollection para manter os controles filho (literal e servidor) do controle do servidor.Creates a new ControlCollection object to hold the child controls (both literal and server) of the server control. (Herdado de HierarchicalDataSourceControl) |
| DataBind() |
Associa uma fonte de dados ao controle de servidor chamado e a todos os seus controles filho.Binds a data source to the invoked server control and all its child controls. (Herdado de Control) |
| DataBind(Boolean) |
Associa uma fonte de dados ao controle de servidor invocado e todos os seus controles filho com uma opção para gerar o evento DataBinding.Binds a data source to the invoked server control and all its child controls with an option to raise the DataBinding event. (Herdado de Control) |
| DataBindChildren() |
Associa uma fonte de dados aos controles filho do controle do servidor.Binds a data source to the server control's child controls. (Herdado de Control) |
| Dispose() |
Permite que um controle de servidor execute a limpeza final antes do lançamento da memória.Enables a server control to perform final clean up before it is released from memory. (Herdado de Control) |
| EndRenderTracing(TextWriter, Object) |
Encerra o rastreamento de tempo de design de dados de renderização.Ends design-time tracing of rendering data. (Herdado de Control) |
| EnsureChildControls() |
Determinará se o controle de servidor contiver controles filho.Determines whether the server control contains child controls. Se ele não contiver, ele criará controles filho.If it does not, it creates child controls. (Herdado de Control) |
| EnsureID() |
Cria um identificador para controles que não têm um identificador atribuído.Creates an identifier for controls that do not have an identifier assigned. (Herdado de Control) |
| Equals(Object) |
Determina se o objeto especificado é igual ao objeto atual.Determines whether the specified object is equal to the current object. (Herdado de Object) |
| FindControl(String) |
Procura o atual contêiner de nomenclatura de um controle de servidor com o parâmetro |
| FindControl(String, Int32) |
Procura o contêiner de nomenclatura atual para um controle de servidor com o |
| Focus() |
Define o foco de entrada para o controle.Sets input focus to the control. (Herdado de HierarchicalDataSourceControl) |
| GetDesignModeState() |
Obtém os dados de tempo de design para um controle.Gets design-time data for a control. (Herdado de Control) |
| GetHashCode() |
Serve como a função de hash padrão.Serves as the default hash function. (Herdado de Object) |
| GetHierarchicalView(String) |
Obtém o objeto de exibição de fonte de dados do controle XmlDataSource.Gets the data source view object for the XmlDataSource control. O parâmetro |
| GetRouteUrl(Object) |
Obtém a URL que corresponde a um conjunto de parâmetros de rota.Gets the URL that corresponds to a set of route parameters. (Herdado de Control) |
| GetRouteUrl(RouteValueDictionary) |
Obtém a URL que corresponde a um conjunto de parâmetros de rota.Gets the URL that corresponds to a set of route parameters. (Herdado de Control) |
| GetRouteUrl(String, Object) |
Obtém a URL que corresponde a um conjunto de parâmetros de rota e um nome de rota.Gets the URL that corresponds to a set of route parameters and a route name. (Herdado de Control) |
| GetRouteUrl(String, RouteValueDictionary) |
Obtém a URL que corresponde a um conjunto de parâmetros de rota e um nome de rota.Gets the URL that corresponds to a set of route parameters and a route name. (Herdado de Control) |
| GetType() |
Obtém o Type da instância atual.Gets the Type of the current instance. (Herdado de Object) |
| GetUniqueIDRelativeTo(Control) |
Retorna a parte prefixada da propriedade UniqueID do controle especificado.Returns the prefixed portion of the UniqueID property of the specified control. (Herdado de Control) |
| GetXmlDocument() |
Carrega os dados XML na memória, diretamente do armazenamento de dados subjacente ou do cache e o retorna no formato de um objeto XmlDataDocument.Loads the XML data into memory, either directly from the underlying data storage or from the cache, and returns it in the form of an XmlDataDocument object. |
| HasControls() |
Determina se o controle de servidor contém algum controle filho.Determines if the server control contains any child controls. (Herdado de HierarchicalDataSourceControl) |
| HasEvents() |
Retorna um valor que indica se os eventos são registrados para o controle ou qualquer controle filho.Returns a value indicating whether events are registered for the control or any child controls. (Herdado de Control) |
| IsLiteralContent() |
Determina se o controle de servidor contém apenas o conteúdo literal.Determines if the server control holds only literal content. (Herdado de Control) |
| LoadControlState(Object) |
Restaura informações de estado de controle de uma solicitação de página anterior que foi salva pelo método SaveControlState().Restores control-state information from a previous page request that was saved by the SaveControlState() method. (Herdado de Control) |
| LoadViewState(Object) |
Restaura informações de estado de exibição de uma solicitação de página anterior salva pelo método SaveViewState().Restores view-state information from a previous page request that was saved by the SaveViewState() method. (Herdado de Control) |
| MapPathSecure(String) |
Recupera o caminho físico para o qual um caminho virtual é mapeado, relativo ou virtual.Retrieves the physical path that a virtual path, either absolute or relative, maps to. (Herdado de Control) |
| MemberwiseClone() |
Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object. (Herdado de Object) |
| OnBubbleEvent(Object, EventArgs) |
Determina se o evento do controle de servidor é passado um nível acima da hierarquia de controle de servidor da interface do usuário da página.Determines whether the event for the server control is passed up the page's UI server control hierarchy. (Herdado de Control) |
| OnDataBinding(EventArgs) |
Aciona o evento DataBinding.Raises the DataBinding event. (Herdado de Control) |
| OnDataSourceChanged(EventArgs) |
Aciona o evento DataSourceChanged.Raises the DataSourceChanged event. (Herdado de HierarchicalDataSourceControl) |
| OnInit(EventArgs) |
Aciona o evento Init.Raises the Init event. (Herdado de Control) |
| OnLoad(EventArgs) |
Aciona o evento Load.Raises the Load event. (Herdado de Control) |
| OnPreRender(EventArgs) |
Aciona o evento PreRender.Raises the PreRender event. (Herdado de Control) |
| OnTransforming(EventArgs) |
Gera o evento Transforming antes que o controle XmlDataSource execute uma transformação XSLT em seus dados XML.Raises the Transforming event before the XmlDataSource control performs an XSLT transformation on its XML data. |
| OnUnload(EventArgs) |
Aciona o evento Unload.Raises the Unload event. (Herdado de Control) |
| OpenFile(String) |
Obtém um Stream usado para ler um arquivo.Gets a Stream used to read a file. (Herdado de Control) |
| RaiseBubbleEvent(Object, EventArgs) |
Atribui quaisquer fontes de evento e suas informações para o pai do controle.Assigns any sources of the event and its information to the control's parent. (Herdado de Control) |
| RemovedControl(Control) |
Chamado após um controle filho ser removido da coleção Controls do objeto Control.Called after a child control is removed from the Controls collection of the Control object. (Herdado de Control) |
| Render(HtmlTextWriter) |
Envia o conteúdo do controle de servidor a um objeto HtmlTextWriter fornecido, que grava o conteúdo a ser renderizado no cliente.Sends server control content to a provided HtmlTextWriter object, which writes the content to be rendered on the client. (Herdado de Control) |
| RenderChildren(HtmlTextWriter) |
Gera o conteúdo dos filhos de um controle de servidor para um objeto HtmlTextWriter fornecido, que grava o conteúdo a ser renderizado no cliente.Outputs the content of a server control's children to a provided HtmlTextWriter object, which writes the content to be rendered on the client. (Herdado de Control) |
| RenderControl(HtmlTextWriter) |
Gera o conteúdo do controle de servidor para um objeto HtmlTextWriter fornecido e armazena informações de rastreamento sobre o controle caso o rastreamento esteja habilitado.Outputs server control content to a provided HtmlTextWriter object and stores tracing information about the control if tracing is enabled. (Herdado de HierarchicalDataSourceControl) |
| RenderControl(HtmlTextWriter, ControlAdapter) |
Gera o conteúdo do controle de servidor a um objeto HtmlTextWriter fornecido usando um objeto ControlAdapter fornecido.Outputs server control content to a provided HtmlTextWriter object using a provided ControlAdapter object. (Herdado de Control) |
| ResolveAdapter() |
Obtém o adaptador de controle responsável por renderizar o controle especificado.Gets the control adapter responsible for rendering the specified control. (Herdado de Control) |
| ResolveClientUrl(String) |
Obtém uma URL que pode ser usada pelo navegador.Gets a URL that can be used by the browser. (Herdado de Control) |
| ResolveUrl(String) |
Converte uma URL em uma que possa ser usada no cliente solicitante.Converts a URL into one that is usable on the requesting client. (Herdado de Control) |
| Save() |
Salvará no disco os dados XML mantidos atualmente na memória pelo controle XmlDataSource se a propriedade DataFile estiver definida.Saves the XML data currently held in memory by the XmlDataSource control to disk if the DataFile property is set. |
| SaveControlState() |
Salva as alterações de estado do controle de servidor que ocorreram desde a hora em que ocorreu o postback da página no servidor.Saves any server control state changes that have occurred since the time the page was posted back to the server. (Herdado de Control) |
| SaveViewState() |
Salva alterações de estado de exibição do controle de servidor que ocorreram desde a hora em que ocorreu o postback da página no servidor.Saves any server control view-state changes that have occurred since the time the page was posted back to the server. (Herdado de Control) |
| SetDesignModeState(IDictionary) |
Define os dados de tempo de design para um controle.Sets design-time data for a control. (Herdado de Control) |
| SetRenderMethodDelegate(RenderMethod) |
Atribui um delegado do manipulador de eventos para renderizar o controle de servidor e seu conteúdo em seu controle pai.Assigns an event handler delegate to render the server control and its content into its parent control. (Herdado de Control) |
| SetTraceData(Object, Object) |
Define os dados de rastreamento para o rastreamento de tempo de design dos dados de renderização, usando a chave e o valor de dados de rastreamento.Sets trace data for design-time tracing of rendering data, using the trace data key and the trace data value. (Herdado de Control) |
| SetTraceData(Object, Object, Object) |
Define os dados de rastreamento para o rastreamento de tempo de design dos dados de renderização, usando o objeto rastreado, a chave e o valor de dados de rastreamento.Sets trace data for design-time tracing of rendering data, using the traced object, the trace data key, and the trace data value. (Herdado de Control) |
| ToString() |
Retorna uma cadeia de caracteres que representa o objeto atual.Returns a string that represents the current object. (Herdado de Object) |
| TrackViewState() |
Causa o acompanhamento das alterações de estado de exibição para o controle de servidor, para que elas possam ser armazenadas no objeto StateBag do controle de servidor.Causes tracking of view-state changes to the server control so they can be stored in the server control's StateBag object. Esse objeto é acessível por meio da propriedade ViewState.This object is accessible through the ViewState property. (Herdado de Control) |
Eventos
| DataBinding |
Ocorre quando o controle de servidor é associado a uma fonte de dados.Occurs when the server control binds to a data source. (Herdado de Control) |
| Disposed |
Ocorre quando um controle de servidor é liberado da memória, que é o último estágio do ciclo de vida de controle de servidor quando uma página ASP.NET é solicitada.Occurs when a server control is released from memory, which is the last stage of the server control lifecycle when an ASP.NET page is requested. (Herdado de Control) |
| Init |
Ocorre quando o controle de servidor é inicializado, que é a primeira etapa do ciclo de vida.Occurs when the server control is initialized, which is the first step in its lifecycle. (Herdado de Control) |
| Load |
Ocorre quando o controle de servidor é carregado no objeto Page.Occurs when the server control is loaded into the Page object. (Herdado de Control) |
| PreRender |
Ocorre depois que o objeto Control é carregado, mas antes da renderização.Occurs after the Control object is loaded but prior to rendering. (Herdado de Control) |
| Transforming |
Ocorre antes que a folha de estilos definida pela propriedade Transform ou identificada pela propriedade TransformFile seja aplicada aos dados XML.Occurs before the style sheet that is defined by the Transform property or identified by the TransformFile property is applied to XML data. |
| Unload |
Ocorre quando o controle de servidor é descarregado da memória.Occurs when the server control is unloaded from memory. (Herdado de Control) |
Implantações explícitas de interface
| IControlBuilderAccessor.ControlBuilder |
Para obter uma descrição desse membro, confira ControlBuilder.For a description of this member, see ControlBuilder. (Herdado de Control) |
| IControlDesignerAccessor.GetDesignModeState() |
Para obter uma descrição desse membro, confira GetDesignModeState().For a description of this member, see GetDesignModeState(). (Herdado de Control) |
| IControlDesignerAccessor.SetDesignModeState(IDictionary) |
Para obter uma descrição desse membro, confira SetDesignModeState(IDictionary).For a description of this member, see SetDesignModeState(IDictionary). (Herdado de Control) |
| IControlDesignerAccessor.SetOwnerControl(Control) |
Para obter uma descrição desse membro, confira SetOwnerControl(Control).For a description of this member, see SetOwnerControl(Control). (Herdado de Control) |
| IControlDesignerAccessor.UserData |
Para obter uma descrição desse membro, confira UserData.For a description of this member, see UserData. (Herdado de Control) |
| IDataBindingsAccessor.DataBindings |
Para obter uma descrição desse membro, confira DataBindings.For a description of this member, see DataBindings. (Herdado de Control) |
| IDataBindingsAccessor.HasDataBindings |
Para obter uma descrição desse membro, confira HasDataBindings.For a description of this member, see HasDataBindings. (Herdado de Control) |
| IDataSource.DataSourceChanged |
Para obter uma descrição desse membro, confira DataSourceChanged.For a description of this member, see DataSourceChanged. |
| IDataSource.GetView(String) |
Obtém a exibição de fonte de dados nomeada associada ao controle de fonte de dados.Gets the named data source view associated with the data source control. |
| IDataSource.GetViewNames() |
Para obter uma descrição desse membro, confira GetViewNames().For a description of this member, see GetViewNames(). |
| IExpressionsAccessor.Expressions |
Para obter uma descrição desse membro, confira Expressions.For a description of this member, see Expressions. (Herdado de Control) |
| IExpressionsAccessor.HasExpressions |
Para obter uma descrição desse membro, confira HasExpressions.For a description of this member, see HasExpressions. (Herdado de Control) |
| IHierarchicalDataSource.DataSourceChanged |
Ocorre quando o HierarchicalDataSourceControl é alterado de alguma forma que afeta controles associados a dados.Occurs when the HierarchicalDataSourceControl has changed in some way that affects data-bound controls. (Herdado de HierarchicalDataSourceControl) |
| IHierarchicalDataSource.GetHierarchicalView(String) |
Obtém o objeto auxiliar de exibição para a interface IHierarchicalDataSource para o caminho especificado.Gets the view helper object for the IHierarchicalDataSource interface for the specified path. (Herdado de HierarchicalDataSourceControl) |
| IListSource.ContainsListCollection |
Para obter uma descrição desse membro, confira ContainsListCollection.For a description of this member, see ContainsListCollection. |
| IListSource.GetList() |
Para obter uma descrição desse membro, confira GetList().For a description of this member, see GetList(). |
| IParserAccessor.AddParsedSubObject(Object) |
Para obter uma descrição desse membro, confira AddParsedSubObject(Object).For a description of this member, see AddParsedSubObject(Object). (Herdado de Control) |
Métodos de Extensão
| FindDataSourceControl(Control) |
Retorna a fonte de dados associada ao controle de dados do controle especificado.Returns the data source that is associated with the data control for the specified control. |
| FindFieldTemplate(Control, String) |
Retorna o modelo do campo para a coluna especificada no contêiner de nomenclatura do controle especificado.Returns the field template for the specified column in the specified control's naming container. |
| FindMetaTable(Control) |
Retorna o objeto metatable para o controle que contém dados.Returns the metatable object for the containing data control. |
| GetDefaultValues(IDataSource) |
Obtém a coleção de valores padrão para a fonte de dados especificada.Gets the collection of the default values for the specified data source. |
| GetMetaTable(IDataSource) |
Obtém os metadados para uma tabela no objeto de fonte de dados especificado.Gets the metadata for a table in the specified data source object. |
| TryGetMetaTable(IDataSource, MetaTable) |
Determina se os metadados da tabela estão disponíveis.Determines whether table metadata is available. |