FormView.CaptionAlign Propriedade
Definição
Obtém ou define a posição horizontal ou vertical de um elemento de legenda HTML em um controle FormView.Gets or sets the horizontal or vertical position of the HTML caption element in a FormView control. Esta propriedade é fornecida para tornar o controle mais acessível para usuários de dispositivos de tecnologia adaptativa.This property is provided to make the control more accessible to users of assistive technology devices.
public:
virtual property System::Web::UI::WebControls::TableCaptionAlign CaptionAlign { System::Web::UI::WebControls::TableCaptionAlign get(); void set(System::Web::UI::WebControls::TableCaptionAlign value); };
public virtual System.Web.UI.WebControls.TableCaptionAlign CaptionAlign { get; set; }
member this.CaptionAlign : System.Web.UI.WebControls.TableCaptionAlign with get, set
Public Overridable Property CaptionAlign As TableCaptionAlign
Valor da propriedade
Um dos valores de TableCaptionAlign.One of the TableCaptionAlign values. O padrão é TableCaptionAlign.NotSet.The default is TableCaptionAlign.NotSet.
Exceções
O valor especificado não é um dos valores de enumeração de TableCaptionAlign.The specified value is not one of the TableCaptionAlign enumeration values.
Exemplos
O exemplo a seguir demonstra como usar a CaptionAlign propriedade para especificar que o elemento de legenda HTML em um FormView controle deve ser renderizado no lado esquerdo do controle.The following example demonstrates how to use the CaptionAlign property to specify that the HTML caption element in a FormView control should be rendered on the left side of the control.
<%@ 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>FormView Caption and CaptionAlign Example</title>
</head>
<body>
<form id="form1" runat="server">
<h3>FormView Caption and CaptionAlign Example</h3>
<asp:formview id="EmployeeFormView"
datasourceid="EmployeeSource"
allowpaging="true"
datakeynames="EmployeeID"
caption="Employee Details"
captionalign="Left"
runat="server">
<itemtemplate>
<table>
<tr>
<td>
<asp:image id="EmployeeImage"
imageurl='<%# Eval("PhotoPath") %>'
alternatetext='<%# Eval("LastName") %>'
runat="server"/>
</td>
<td>
<h3><%# Eval("FirstName") %> <%# Eval("LastName") %></h3>
<%# Eval("Title") %>
</td>
</tr>
</table>
</itemtemplate>
<pagersettings position="Bottom"
mode="NextPrevious"/>
</asp:formview>
<!-- This example uses Microsoft SQL Server and connects -->
<!-- to the Northwind sample database. Use an ASP.NET -->
<!-- expression to retrieve the connection string value -->
<!-- from the Web.config file. -->
<asp:sqldatasource id="EmployeeSource"
selectcommand="Select [EmployeeID], [LastName], [FirstName], [Title], [PhotoPath] From [Employees]"
connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>"
runat="server"/>
</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>FormView Caption and CaptionAlign Example</title>
</head>
<body>
<form id="form1" runat="server">
<h3>FormView Caption and CaptionAlign Example</h3>
<asp:formview id="EmployeeFormView"
datasourceid="EmployeeSource"
allowpaging="true"
datakeynames="EmployeeID"
caption="Employee Details"
captionalign="Left"
runat="server">
<itemtemplate>
<table>
<tr>
<td>
<asp:image id="EmployeeImage"
imageurl='<%# Eval("PhotoPath") %>'
alternatetext='<%# Eval("LastName") %>'
runat="server"/>
</td>
<td>
<h3><%# Eval("FirstName") %> <%# Eval("LastName") %></h3>
<%# Eval("Title") %>
</td>
</tr>
</table>
</itemtemplate>
<pagersettings position="Bottom"
mode="NextPrevious"/>
</asp:formview>
<!-- This example uses Microsoft SQL Server and connects -->
<!-- to the Northwind sample database. Use an ASP.NET -->
<!-- expression to retrieve the connection string value -->
<!-- from the Web.config file. -->
<asp:sqldatasource id="EmployeeSource"
selectcommand="Select [EmployeeID], [LastName], [FirstName], [Title], [PhotoPath] From [Employees]"
connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>"
runat="server"/>
</form>
</body>
</html>
Comentários
Use a CaptionAlign propriedade para especificar a posição horizontal ou vertical do elemento de legenda HTML em um FormView controle.Use the CaptionAlign property to specify the horizontal or vertical position of the HTML caption element in a FormView control. Esta propriedade é fornecida para tornar o controle mais acessível para usuários de dispositivos de tecnologia adaptativa.This property is provided to make the control more accessible to users of assistive technology devices.
Essa propriedade é definida usando um dos TableCaptionAlign valores de enumeração.This property is set using one of the TableCaptionAlign enumeration values. A tabela a seguir lista os valores possíveis.The following table lists the possible values.
| ValorValue | DescriçãoDescription |
|---|---|
TableCaptionAlign.Bottom |
O elemento de legenda é alinhado à parte inferior da tabela.The caption element is aligned with the bottom of the table. |
TableCaptionAlign.Left |
O elemento de legenda é alinhado ao lado esquerdo da tabela.The caption element is aligned with the left side of the table. |
TableCaptionAlign.NotSet |
O alinhamento do elemento de legenda não está definido.The caption element's alignment is not set. |
TableCaptionAlign.Right |
O elemento de legenda é alinhado ao lado direito da tabela.The caption element is aligned with the right side of the table. |
TableCaptionAlign.Top |
O elemento de legenda é alinhado à parte superior da tabela.The caption element is aligned with the top of the table. |
Observação
Quando essa propriedade é definida como TableCaptionAlign.NotSet , o valor padrão do navegador é usado.When this property is set to TableCaptionAlign.NotSet, the default value of the browser is used.
O suporte de acessibilidade adicional para o FormView controle é fornecido pela Caption propriedade.Additional accessibility support for the FormView control is provided by the Caption property. Use a Caption propriedade para especificar o texto a ser processado em um elemento de legenda HTML em um FormView controle.Use the Caption property to specify the text to render in an HTML caption element in a FormView control.