FormView.CaptionAlign Eigenschap

Definitie

Hiermee haalt u de horizontale of verticale positie van het HTML-bijschriftelement in een FormView besturingselement op of stelt u deze in. Deze eigenschap wordt verstrekt om het beheer toegankelijker te maken voor gebruikers van ondersteunende technologieapparaten.

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

Waarde van eigenschap

Een van de TableCaptionAlign waarden. De standaardwaarde is TableCaptionAlign.NotSet.

Uitzonderingen

De opgegeven waarde is geen van de TableCaptionAlign opsommingswaarden.

Voorbeelden

In het volgende voorbeeld ziet u hoe u de CaptionAlign eigenschap gebruikt om op te geven dat het HTML-bijschriftelement in een FormView besturingselement aan de linkerkant van het besturingselement moet worden weergegeven.


<%@ 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>

Opmerkingen

Gebruik de CaptionAlign eigenschap om de horizontale of verticale positie van het HTML-bijschriftelement in een FormView besturingselement op te geven. Deze eigenschap wordt verstrekt om het beheer toegankelijker te maken voor gebruikers van ondersteunende technologieapparaten.

Deze eigenschap wordt ingesteld met behulp van een van de TableCaptionAlign opsommingswaarden. De volgende tabel bevat de mogelijke waarden.

Waarde Beschrijving
TableCaptionAlign.Bottom Het bijschriftelement wordt uitgelijnd met de onderkant van de tabel.
TableCaptionAlign.Left Het bijschriftelement wordt uitgelijnd met de linkerkant van de tabel.
TableCaptionAlign.NotSet De uitlijning van het bijschriftelement is niet ingesteld.
TableCaptionAlign.Right Het bijschriftelement wordt uitgelijnd met de rechterkant van de tabel.
TableCaptionAlign.Top Het bijschriftelement wordt uitgelijnd met de bovenkant van de tabel.

Note

Wanneer deze eigenschap is ingesteld op TableCaptionAlign.NotSet, wordt de standaardwaarde van de browser gebruikt.

Aanvullende ondersteuning voor toegankelijkheid voor het FormView besturingselement wordt geleverd door de Caption eigenschap. Gebruik de Caption eigenschap om de tekst op te geven die moet worden weergegeven in een HTML-bijschriftelement in een FormView besturingselement.

Van toepassing op

Zie ook