UpdatePanel Classe
Definição
Permite que seções de uma página sejam parcialmente renderizadas sem um postback.Enables sections of a page to be partially rendered without a postback.
public ref class UpdatePanel : System::Web::UI::Control
public ref class UpdatePanel : System::Web::UI::Control, System::Web::UI::IAttributeAccessor
[System.Drawing.ToolboxBitmap(typeof(EmbeddedResourceFinder), "System.Web.Resources.UpdatePanel.bmp")]
public class UpdatePanel : System.Web.UI.Control
[System.Drawing.ToolboxBitmap(typeof(EmbeddedResourceFinder), "System.Web.Resources.UpdatePanel.bmp")]
public class UpdatePanel : System.Web.UI.Control, System.Web.UI.IAttributeAccessor
[<System.Drawing.ToolboxBitmap(typeof(EmbeddedResourceFinder), "System.Web.Resources.UpdatePanel.bmp")>]
type UpdatePanel = class
inherit Control
[<System.Drawing.ToolboxBitmap(typeof(EmbeddedResourceFinder), "System.Web.Resources.UpdatePanel.bmp")>]
type UpdatePanel = class
inherit Control
interface IAttributeAccessor
Public Class UpdatePanel
Inherits Control
Public Class UpdatePanel
Inherits Control
Implements IAttributeAccessor
- Herança
- Atributos
- Implementações
Exemplos
Os exemplos a seguir mostram vários usos do UpdatePanel controle.The following examples show various uses of the UpdatePanel control.
Controles dentro de um controle UpdatePanelControls Inside an UpdatePanel Control
O exemplo a seguir mostra como colocar controles dentro de um UpdatePanel controle para reduzir a cintilação da tela quando você posta para o servidor.The following example shows how to put controls inside an UpdatePanel control to reduce screen flicker when you post to the server. Neste exemplo, um Calendar e um DropDownList controle estão dentro de um UpdatePanel controle.In this example, a Calendar and a DropDownList control are inside an UpdatePanel control. Por padrão, a UpdateMode propriedade é Always e a ChildrenAsTriggers propriedade é true .By default, the UpdateMode property is Always and the ChildrenAsTriggers property is true. Portanto, os controles filho do painel causam um postback assíncrono.Therefore, child controls of the panel cause an asynchronous postback.
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
void DropDownSelection_Change(Object sender, EventArgs e)
{
Calendar1.DayStyle.BackColor =
System.Drawing.Color.FromName(ColorList.SelectedItem.Value);
}
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
SelectedDate.Text =
Calendar1.SelectedDate.ToString();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>UpdatePanel Example</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1"
runat="server" />
<asp:UpdatePanel ID="UpdatePanel1"
runat="server">
<ContentTemplate>
<asp:Calendar ID="Calendar1"
ShowTitle="True"
OnSelectionChanged="Calendar1_SelectionChanged"
runat="server" />
<div>
Background:
<br />
<asp:DropDownList ID="ColorList"
AutoPostBack="True"
OnSelectedIndexChanged="DropDownSelection_Change"
runat="server">
<asp:ListItem Selected="True" Value="White">
White </asp:ListItem>
<asp:ListItem Value="Silver">
Silver </asp:ListItem>
<asp:ListItem Value="DarkGray">
Dark Gray </asp:ListItem>
<asp:ListItem Value="Khaki">
Khaki </asp:ListItem>
<asp:ListItem Value="DarkKhaki"> D
ark Khaki </asp:ListItem>
</asp:DropDownList>
</div>
<br />
Selected date:
<asp:Label ID="SelectedDate"
runat="server">None.</asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
<br />
</div>
</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">
<script runat="server">
Sub DropDownSelection_Change(ByVal Sender As Object, ByVal E As EventArgs)
Calendar1.DayStyle.BackColor = _
System.Drawing.Color.FromName(ColorList.SelectedItem.Value)
End Sub
Protected Sub Calendar1_SelectionChanged(ByVal Sender As Object, ByVal E As EventArgs)
SelectedDate.Text = Calendar1.SelectedDate.ToString()
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>UpdatePanel Example</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1"
runat="server" />
<asp:UpdatePanel ID="UpdatePanel1"
runat="server">
<ContentTemplate>
<asp:Calendar ID="Calendar1"
ShowTitle="True"
OnSelectionChanged="Calendar1_SelectionChanged"
runat="server" />
<div>
Background:
<br />
<asp:DropDownList ID="ColorList"
AutoPostBack="True"
OnSelectedIndexChanged="DropDownSelection_Change"
runat="server">
<asp:ListItem Selected="True" Value="White">
White </asp:ListItem>
<asp:ListItem Value="Silver">
Silver </asp:ListItem>
<asp:ListItem Value="DarkGray">
Dark Gray </asp:ListItem>
<asp:ListItem Value="Khaki">
Khaki </asp:ListItem>
<asp:ListItem Value="DarkKhaki"> D
ark Khaki </asp:ListItem>
</asp:DropDownList>
</div>
<br />
Selected date:
<asp:Label ID="SelectedDate"
runat="server">None.</asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
<br />
</div>
</form>
</body>
</html>
Cenário de mestre/detalhes com controles UpdatePanelMaster/Detail Scenario with UpdatePanel Controls
No exemplo a seguir, um UpdatePanel controle é usado em um cenário de mestre/detalhes que mostra pedidos e detalhes do pedido do banco de dados Northwind.In the following example, an UpdatePanel control is used in a master/detail scenario that shows orders and order details from the Northwind database. Um UpdatePanel controle contém o GridView controle que exibe uma lista de pedidos.One UpdatePanel control contains the GridView control that displays a list of orders. Um segundo UpdatePanel controle contém um DetailsView controle que exibe os detalhes de uma ordem.A second UpdatePanel control contains a DetailsView control that displays the details of one order. Quando você seleciona um pedido da primeira tabela, os detalhes dessa ordem são exibidos na segunda tabela.When you select an order from the first table, details for that order are displayed in the second table. A segunda tabela é atualizada de forma assíncrona com base na seleção na primeira tabela.The second table is updated asynchronously based on the selection in the first table. As operações de classificação e paginação na tabela de Resumo de pedidos também causam atualizações parciais.The sorting and paging operations in the orders summary table also cause partial updates.
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
SqlDataSource2.SelectParameters["OrderID"].DefaultValue =
GridView1.SelectedDataKey.Value.ToString();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>UpdatePanel Example</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1"
runat="server" />
<asp:UpdatePanel ID="OrdersPanel"
UpdateMode="Conditional"
runat="server">
<ContentTemplate>
<asp:GridView ID="GridView1"
AllowPaging="True"
AllowSorting="True"
Caption="Orders"
DataKeyNames="OrderID"
DataSourceID="SqlDataSource1"
OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
runat="server" >
<Columns>
<asp:CommandField ShowSelectButton="True"></asp:CommandField>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1"
runat="server"
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [OrderID], [CustomerID], [EmployeeID], [OrderDate] FROM [Orders]">
</asp:SqlDataSource>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="OrderDetailsPanel"
UpdateMode="Always"
runat="server">
<ContentTemplate>
<asp:DetailsView ID="DetailsView1"
Caption="Order Details"
DataKeyNames="OrderID,ProductID"
DataSourceID="SqlDataSource2"
runat="server">
<EmptyDataTemplate>
<i>Select a row from the Orders table.</i>
</EmptyDataTemplate>
</asp:DetailsView>
<asp:SqlDataSource ID="SqlDataSource2"
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [OrderID], [ProductID], [UnitPrice], [Quantity], [Discount] FROM [Order Details] WHERE ([OrderID] = @OrderID)"
runat="server">
<SelectParameters>
<asp:Parameter Name="OrderID"
Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</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">
<script runat="server">
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
SqlDataSource2.SelectParameters("OrderID").DefaultValue = _
GridView1.SelectedDataKey.Value.ToString()
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>UpdatePanel Example</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1"
runat="server" />
<asp:UpdatePanel ID="OrdersPanel"
UpdateMode="Conditional"
runat="server">
<ContentTemplate>
<asp:GridView ID="GridView1"
AllowPaging="True"
AllowSorting="True"
Caption="Orders"
DataKeyNames="OrderID"
DataSourceID="SqlDataSource1"
OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
runat="server" >
<Columns>
<asp:CommandField ShowSelectButton="True"></asp:CommandField>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1"
runat="server"
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [OrderID], [CustomerID], [EmployeeID], [OrderDate] FROM [Orders]">
</asp:SqlDataSource>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="OrderDetailsPanel"
UpdateMode="Always"
runat="server">
<ContentTemplate>
<asp:DetailsView ID="DetailsView1"
Caption="Order Details"
DataKeyNames="OrderID,ProductID"
DataSourceID="SqlDataSource2"
runat="server">
<EmptyDataTemplate>
<i>Select a row from the Orders table.</i>
</EmptyDataTemplate>
</asp:DetailsView>
<asp:SqlDataSource ID="SqlDataSource2"
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [OrderID], [ProductID], [UnitPrice], [Quantity], [Discount] FROM [Order Details] WHERE ([OrderID] = @OrderID)"
runat="server">
<SelectParameters>
<asp:Parameter Name="OrderID"
Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
Se você colocar um GridView controle dentro de um UpdatePanel controle, GridView EnableSortingAndPagingCallbacks true não haverá suporte para definir a propriedade do controle como.If you put a GridView control inside an UpdatePanel control, setting the GridView control's EnableSortingAndPagingCallbacks property to true is not supported. No entanto, como o UpdatePanel controle dá suporte a postbacks assíncronos, quaisquer postbacks que alteram o GridView controle dentro de um UpdatePanel controle causam o mesmo comportamento de retornos de chamada de classificação e de paginação.However, because the UpdatePanel control supports asynchronous postbacks, any postbacks that change the GridView control inside an UpdatePanel control cause the same behavior as sorting and paging callbacks.
Usando um controle UpdatePanel em um modeloUsing an UpdatePanel Control in a Template
No exemplo a seguir, um UpdatePanel controle é usado no modelo de item de um GridView controle.In the following example, an UpdatePanel control is used in the item template of a GridView control. UpdatePanel os controles em cada linha de dados são gerados automaticamente.UpdatePanel controls in each data row are generated automatically. O controle de cada linha UpdatePanel contém um Label controle para exibir a quantidade do item nessa linha e um Button controle para diminuir e aumentar a quantidade.Each row's UpdatePanel control contains a Label control to display the quantity of the item in that row and a Button control to decrease and increase the quantity.
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
private void ChangeQuantity(object sender, int delta)
{
Label quantityLabel = (Label)((Button)sender).FindControl("QuantityLabel");
int currentQuantity = Int32.Parse(quantityLabel.Text);
currentQuantity = Math.Max(0, currentQuantity + delta);
quantityLabel.Text = currentQuantity.ToString(System.Globalization.CultureInfo.InvariantCulture);
}
private void OnDecreaseQuantity(object sender, EventArgs e)
{
ChangeQuantity(sender, -1);
}
private void OnIncreaseQuantity(object sender, EventArgs e)
{
ChangeQuantity(sender, 1);
}
protected void Button1_Click(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
sb.Append("Beverage order:<br/>");
foreach (GridViewRow row in GridView1.Rows)
{
if (row.RowType == DataControlRowType.DataRow)
{
Label quantityLabel = (Label)row.FindControl("QuantityLabel");
int currentQuantity = Int32.Parse(quantityLabel.Text);
sb.Append(row.Cells[0].Text + " : " + currentQuantity + "<br/>");
}
}
SummaryLabel.Text = sb.ToString();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>UpdatePanel Inside GridView Template Example </title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1"
runat="server" />
<asp:GridView ID="GridView1"
AutoGenerateColumns="False"
DataSourceID="SqlDataSource1"
runat="server">
<Columns>
<asp:BoundField DataField="ProductName"
HeaderText="ProductName" />
<asp:BoundField DataField="UnitPrice"
HeaderText="UnitPrice" />
<asp:TemplateField HeaderText="Quantity">
<ItemTemplate>
<asp:UpdatePanel ID="QuantityUpdatePanel"
UpdateMode="Conditional"
runat="server" >
<ContentTemplate>
<asp:Label ID="QuantityLabel"
Text="0"
runat="server" />
<asp:Button ID="DecreaseQuantity"
Text="-"
OnClick="OnDecreaseQuantity"
runat="server" />
<asp:Button ID="IncreaseQuantity"
Text="+"
OnClick="OnIncreaseQuantity"
runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:UpdatePanel ID="SummaryUpdatePanel"
UpdateMode="Conditional"
runat="server">
<ContentTemplate>
<asp:Button ID="Button1"
OnClick="Button1_Click"
Text="Get Summary"
runat="server" />
<br />
<asp:Label ID="SummaryLabel"
runat="server">
</asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
<asp:SqlDataSource ID="SqlDataSource1"
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [ProductName], [UnitPrice] FROM
[Alphabetical list of products] WHERE ([CategoryName]
LIKE '%' + @CategoryName + '%')"
runat="server">
<SelectParameters>
<asp:Parameter DefaultValue="Beverages"
Name="CategoryName"
Type="String" />
</SelectParameters>
</asp:SqlDataSource>
</div>
</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">
<script runat="server">
Private Sub ChangeQuantity(ByVal Sender As Button, ByVal delta As Integer)
Dim quantityLabel As Label = CType(Sender.FindControl("QuantityLabel"), Label)
Dim currentQuantity As Integer = Int32.Parse(quantityLabel.Text)
currentQuantity = Math.Max(0, currentQuantity + delta)
quantityLabel.Text = currentQuantity.ToString(System.Globalization.CultureInfo.InvariantCulture)
End Sub
Private Sub OnDecreaseQuantity(ByVal Sender As Object, ByVal E As EventArgs)
ChangeQuantity(Sender, -1)
End Sub
Private Sub OnIncreaseQuantity(ByVal Sender As Object, ByVal E As EventArgs)
ChangeQuantity(Sender, 1)
End Sub
Protected Sub Button1_Click(ByVal Sender As Object, ByVal E As EventArgs)
Dim sb As New StringBuilder()
sb.Append("Beverage order:<br/>")
For Each row As GridViewRow In GridView1.Rows
If row.RowType = DataControlRowType.DataRow Then
Dim quantityLabel As Label = CType(row.FindControl("QuantityLabel"), Label)
Dim currentQuantity As Int32 = Int32.Parse(quantityLabel.Text)
sb.Append(row.Cells(0).Text + " : " & currentQuantity & "<br/>")
End If
Next
SummaryLabel.Text = sb.ToString()
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>UpdatePanel Inside GridView Template Example </title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1"
runat="server" />
<asp:GridView ID="GridView1"
AutoGenerateColumns="False"
DataSourceID="SqlDataSource1"
runat="server">
<Columns>
<asp:BoundField DataField="ProductName"
HeaderText="ProductName" />
<asp:BoundField DataField="UnitPrice"
HeaderText="UnitPrice" />
<asp:TemplateField HeaderText="Quantity">
<ItemTemplate>
<asp:UpdatePanel ID="QuantityUpdatePanel"
runat="server" >
<ContentTemplate>
<asp:Label ID="QuantityLabel"
Text="0"
runat="server" />
<asp:Button ID="DecreaseQuantity"
Text="-"
OnClick="OnDecreaseQuantity"
runat="server" />
<asp:Button ID="IncreaseQuantity"
Text="+"
OnClick="OnIncreaseQuantity"
runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:UpdatePanel ID="SummaryUpdatePanel"
runat="server">
<ContentTemplate>
<asp:Button ID="Button1"
OnClick="Button1_Click"
Text="Get Summary"
runat="server" />
<br />
<asp:Label ID="SummaryLabel"
runat="server">
</asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
<asp:SqlDataSource ID="SqlDataSource1"
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [ProductName], [UnitPrice] FROM
[Alphabetical list of products] WHERE ([CategoryName]
LIKE '%' + @CategoryName + '%')"
runat="server">
<SelectParameters>
<asp:Parameter DefaultValue="Beverages"
Name="CategoryName"
Type="String" />
</SelectParameters>
</asp:SqlDataSource>
</div>
</form>
</body>
</html>
Comentários
Neste tópico:In this topic:
IntroduçãoIntroduction
UpdatePanel os controles são uma parte central da funcionalidade AJAX no ASP.NET.UpdatePanel controls are a central part of AJAX functionality in ASP.NET. Eles são usados com o ScriptManager controle para habilitar a renderização parcial da página.They are used with the ScriptManager control to enable partial-page rendering. A renderização parcial da página reduz a necessidade de postbacks síncronos e atualizações de página completas quando apenas parte da página precisa ser atualizada.Partial-page rendering reduces the need for synchronous postbacks and complete page updates when only part of the page has to be updated. A renderização parcial da página melhora a experiência do usuário porque reduz a cintilação da tela que ocorre durante um postback de página inteira e melhora a interatividade da página da Web.Partial-page rendering improves the user experience because it reduces the screen flicker that occurs during a full-page postback and improves Web page interactivity.
Atualizando conteúdo UpdatePanelRefreshing UpdatePanel Content
Quando a renderização de página parcial está habilitada, um controle pode executar um postback que atualiza a página inteira ou um postback assíncrono que atualiza o conteúdo de um ou mais UpdatePanel controles.When partial-page rendering is enabled, a control can perform a postback that updates the whole page or an asynchronous postback that updates the content of one or more UpdatePanel controls. O fato de um controle causar um postback assíncrono e atualizar um UpdatePanel controle depende do seguinte:Whether a control causes an asynchronous postback and updates an UpdatePanel control depends on the following:
Se a UpdateMode Propriedade do UpdatePanel controle for definida como Always , o UpdatePanel conteúdo do controle será atualizado em todos os postbacks provenientes da página.If the UpdateMode property of the UpdatePanel control is set to Always, the UpdatePanel control's content is updated on every postback that originates from the page. Isso inclui postbacks assíncronos de controles que estão dentro UpdatePanel de outros controles e postbacks de controles que não estão dentro de UpdatePanel controles.This includes asynchronous postbacks from controls that are inside other UpdatePanel controls and postbacks from controls that are not inside UpdatePanel controls.
Se a UpdateMode propriedade for definida como Conditional , o UpdatePanel conteúdo do controle será atualizado nas seguintes circunstâncias:If the UpdateMode property is set to Conditional, the UpdatePanel control's content is updated in the following circumstances:
Quando você chama o Update método do UpdatePanel controle explicitamente.When you call the Update method of the UpdatePanel control explicitly.
Quando o UpdatePanel controle é aninhado dentro de outro UpdatePanel controle, e o painel pai é atualizado.When the UpdatePanel control is nested inside another UpdatePanel control, and the parent panel is updated.
Quando um postback é causado por um controle que é definido como um gatilho usando a
TriggersPropriedade do UpdatePanel controle.When a postback is caused by a control that is defined as a trigger by using theTriggersproperty of the UpdatePanel control. Nesse cenário, o controle dispara explicitamente uma atualização do conteúdo do painel.In this scenario, the control explicitly triggers an update of the panel content. O controle pode estar dentro ou fora do UpdatePanel controle ao qual o gatilho está associado.The control can be either inside or outside the UpdatePanel control that the trigger is associated with.Quando a ChildrenAsTriggers propriedade é definida como
truee um controle filho do UpdatePanel controle causa um postback.When the ChildrenAsTriggers property is set totrueand a child control of the UpdatePanel control causes a postback. Controles filho de controles aninhados UpdatePanel não causam uma atualização para o UpdatePanel controle externo, a menos que sejam explicitamente definidos como gatilhos.Child controls of nested UpdatePanel controls do not cause an update to the outer UpdatePanel control unless they are explicitly defined as triggers.
A combinação de definir a ChildrenAsTriggers propriedade como false e a UpdateMode propriedade como Always não é permitida e gerará uma exceção.The combination of setting the ChildrenAsTriggers property to false and the UpdateMode property to Always is not allowed and will throw an exception.
Quando o UpdatePanel controle executa uma postagem assíncrona, ele adiciona um cabeçalho HTTP personalizado.When the UpdatePanel control performs an asynchronous post, it adds a custom HTTP header. Alguns proxies removem esse cabeçalho HTTP personalizado.Some proxies remove this custom HTTP header. Se isso ocorrer, o servidor tratará a solicitação como um postback regular, o que causará um erro de cliente.If this occurs, the server handles the request as a regular postback, which causes a client error. Para resolver esse problema, insira um campo de formulário personalizado ao executar postagens assíncronas.To resolve this issue, insert a custom form field when you perform asynchronous posts. Em seguida, verifique o cabeçalho ou o campo de formulário personalizado no código do servidor.Then check the header or the custom form field in server code.
Uso de UpdatePanelUpdatePanel Usage
Você pode usar vários UpdatePanel controles para atualizar várias regiões de página de forma independente.You can use multiple UpdatePanel controls to update multiple page regions independently. Quando a página que contém um ou mais UpdatePanel controles é processada pela primeira vez, todo o conteúdo de todos os UpdatePanel controles é renderizado e enviado ao navegador.When the page that contains one or more UpdatePanel controls is first rendered, all the content of all UpdatePanel controls are rendered and sent to the browser. Nos postbacks assíncronos subsequentes, o conteúdo de cada UpdatePanel controle pode não ser atualizado dependendo das configurações do painel e da lógica do cliente ou do servidor para painéis individuais.On subsequent asynchronous postbacks, the content of each UpdatePanel control might not be updated depending on the panel settings and on client or server logic for individual panels.
Você também pode usar UpdatePanel controles para o seguinte:You can also use UpdatePanel controls for the following:
Em controles de usuário.In user controls.
Em páginas mestras e de conteúdo.On master and content pages.
Aninhado dentro de outros UpdatePanel controles.Nested inside other UpdatePanel controls.
Dentro de controles de modelo, como GridView os Repeater controles ou.Inside templated controls such as the GridView or Repeater controls.
UpdatePanel os controles podem ser adicionados de forma declarativa ou programaticamente.UpdatePanel controls can be added declaratively or programmatically.
Você pode adicionar um UpdatePanel controle programaticamente, mas não pode adicionar gatilhos programaticamente.You can add an UpdatePanel control programmatically, but you cannot add triggers programmatically. Para criar um comportamento semelhante a um gatilho, você pode registrar um controle na página como um controle de postback assíncrono.To create trigger-like behavior, you can register a control on the page as an asynchronous postback control. Você faz isso chamando o RegisterAsyncPostBackControl método do ScriptManager controle.You do this by calling the RegisterAsyncPostBackControl method of the ScriptManager control. Em seguida, você pode criar um manipulador de eventos que é executado em resposta ao postback assíncrono e, no manipulador, chamar o Update método do UpdatePanel controle.You can then create an event handler that runs in response to the asynchronous postback, and in the handler, call the Update method of the UpdatePanel control.
Aplicando estilosApplying Styles
O UpdatePanel controle aceita atributos expandos.The UpdatePanel control accepts expando attributes. Isso permite que você defina uma classe CSS para os elementos HTML que os controles renderizam.This lets you set a CSS class for the HTML elements that the controls render. Por exemplo, você pode criar a marcação mostrada no exemplo a seguir:For example, you might create the markup shown in the following example:
<asp:UpdatePanel runat="server" class="myStyle">
</asp:UpdatePanel>
A marcação no exemplo anterior renderiza HTML semelhante ao seguinte quando a página é executada:The markup in the previous example renders HTML similar to the following when the page runs:
<div id="ctl00_MainContent_UpdatePanel1" class="MyStyle">
</div>
Sintaxe declarativaDeclarative Syntax
<asp:UpdatePanel
ChildrenAsTriggers="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"
OnUnload="Unload event handler"
RenderMode="Block|Inline"
runat="server"
SkinID="string"
UpdateMode="Always|Conditional"
Visible="True|False"
>
<ContentTemplate>
<!-- child controls -->
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger
ControlID="string"
EventName="string"
/>
<asp:PostBackTrigger
ControlID="string"
/>
</Triggers>
</asp:UpdatePanel>
Construtores
| UpdatePanel() |
Inicializa uma nova instância da classe UpdatePanel.Initializes a new instance of the UpdatePanel 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) |
| Attributes |
Obtém a coleção de atributos CSS (folha de estilos em cascata) do controle UpdatePanel.Gets the cascading style sheet (CSS) attributes collection of the UpdatePanel 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) |
| 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) |
| ChildrenAsTriggers |
Obtém ou define um valor que indica se os postbacks de controles filho imediatos de um controle UpdatePanel atualizam o conteúdo do painel.Gets or sets a value that indicates whether postbacks from immediate child controls of an UpdatePanel control update the panel's content. |
| ClientID |
Obtém a ID de controle de marcação HTML gerada pelo ASP.NET.Gets the control ID for HTML markup that is generated by ASP.NET. (Herdado de Control) |
| ClientIDMode |
Obtém ou define o algoritmo usado para gerar o valor da propriedade ClientID.Gets or sets the algorithm that is used to generate the value of the ClientID property. (Herdado de Control) |
| 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) |
| ContentTemplate |
Obtém ou define o modelo que define o conteúdo do controle UpdatePanel.Gets or sets the template that defines the content of the UpdatePanel control. |
| ContentTemplateContainer |
Obtém um objeto de controle ao qual você pode adicionar programaticamente filho.Gets a control object to which you can programmatically add child controls. |
| 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 o objeto ControlCollection que contém os controles filho para o controle UpdatePanel.Gets the ControlCollection object that contains the child controls for the UpdatePanel control. |
| 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) |
| EnableTheming |
Obtém ou define um valor que indica se os temas se aplicam a esse controle.Gets or sets a value indicating whether themes apply to this control. (Herdado de Control) |
| 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) |
| IsInPartialRendering |
Obtém um valor que indica se o controle UpdatePanel está sendo atualizado como resultado de um postback assíncrono.Gets a value that indicates whether the UpdatePanel control is being updated as a result of an asynchronous postback. |
| 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) |
| RenderMode |
Obtém ou define um valor que indica se o conteúdo do controle de um UpdatePanel é circunscrito em um elemento |
| RequiresUpdate |
Obtém um valor que indica se o conteúdo do controle UpdatePanel será atualizado.Gets a value that indicates whether the content of the UpdatePanel control will be updated. |
| 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.Gets or sets the skin to apply to the control. (Herdado de Control) |
| 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) |
| Triggers |
Obtém um objeto UpdatePanelTriggerCollection que contém objetos AsyncPostBackTrigger e PostBackTrigger que foram registrados declarativamente para o controle UpdatePanel.Gets an UpdatePanelTriggerCollection object that contains AsyncPostBackTrigger and PostBackTrigger objects that were registered declaratively for the UpdatePanel 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) |
| UpdateMode |
Obtém ou define um valor que indica quando o conteúdo do controle de um UpdatePanel é atualizado.Gets or sets a value that indicates when an UpdatePanel control's content is updated. |
| 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 que indica se um controle de servidor é renderizado como uma interface do usuário na página.Gets or sets a value that indicates whether a server control is rendered as UI on the page. (Herdado de Control) |
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 defined in the page style sheet to the control. (Herdado de Control) |
| 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) |
| CreateContentTemplateContainer() |
Cria um objeto Control que funciona como um contêiner para os controles filho que definem o conteúdo do controle UpdatePanel.Creates a Control object that acts as a container for child controls that define the UpdatePanel control's content. |
| CreateControlCollection() |
Retorna a coleção de todos os controles contidos no controle UpdatePanel.Returns the collection of all controls contained in the UpdatePanel control. |
| 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 um controle.Sets input focus to a control. (Herdado de Control) |
| 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) |
| 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) |
| HasControls() |
Determina se o controle de servidor contém algum controle filho.Determines if the server control contains any child controls. (Herdado de Control) |
| 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) |
| Initialize() |
Inicializa o controle UpdatePanel da coleção de gatilho se uma renderização parcial da página estiver habilitada.Initializes the UpdatePanel control trigger collection if partial-page rendering is enabled. |
| 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) |
| OnInit(EventArgs) | |
| OnLoad(EventArgs) |
Gera o evento Load para o controle UpdatePanel e invoca o método Initialize() quando a renderização parcial da página não está habilitada.Raises the Load event for the UpdatePanel control and invokes the Initialize() method when partial-page rendering is not enabled. |
| OnPreRender(EventArgs) | |
| OnUnload(EventArgs) | |
| 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) |
Aciona o evento Render(HtmlTextWriter).Raises the Render(HtmlTextWriter) event. |
| RenderChildren(HtmlTextWriter) |
Aciona o evento RenderChildren(HtmlTextWriter).Raises the RenderChildren(HtmlTextWriter) event. |
| 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 Control) |
| 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) |
| 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) |
| Update() |
Causa uma atualização do conteúdo de um controle UpdatePanel.Causes an update of the content of an UpdatePanel 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) |
| 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
| IAttributeAccessor.GetAttribute(String) |
Retorna um atributo de um controle da Web usando um nome especificado.Returns an attribute of a Web control by using a specified name. |
| IAttributeAccessor.SetAttribute(String, String) |
Define o valor do atributo de controle especificado.Sets the value of the specified control attribute. |
| 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) |
| 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) |
| 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. |