FormView.FooterStyle Propriété

Définition

Obtient une référence à l'objet TableItemStyle vous permettant de définir l'apparence de la ligne de pied de page dans un contrôle FormView.

public:
 property System::Web::UI::WebControls::TableItemStyle ^ FooterStyle { System::Web::UI::WebControls::TableItemStyle ^ get(); };
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public System.Web.UI.WebControls.TableItemStyle FooterStyle { get; }
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
member this.FooterStyle : System.Web.UI.WebControls.TableItemStyle
Public ReadOnly Property FooterStyle As TableItemStyle

Valeur de propriété

Référence à TableItemStyle qui représente le style de la ligne de pied de page dans un contrôle FormView.

Attributs

Exemples

L’exemple suivant montre comment utiliser la FooterStyle propriété pour spécifier un style personnalisé pour la ligne de pied de page.


<%@ 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 FooterText Example</title>
</head>
<body>
    <form id="form1" runat="server">
        
      <h3>FormView FooterText Example</h3>
                       
      <asp:formview id="EmployeeFormView"
        datasourceid="EmployeeSource"
        allowpaging="true" 
        datakeynames="EmployeeID"
        footertext="Confidential" 
        runat="server">
        
        <footerstyle horizontalalign="Center"
          forecolor="White"
          backcolor="Red"/>
           
        <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 FooterText Example</title>
</head>
<body>
    <form id="form1" runat="server">
        
      <h3>FormView FooterText Example</h3>
                       
      <asp:formview id="EmployeeFormView"
        datasourceid="EmployeeSource"
        allowpaging="true" 
        datakeynames="EmployeeID"
        footertext="Confidential" 
        runat="server">
        
        <footerstyle horizontalalign="Center"
          forecolor="White"
          backcolor="Red"/>
           
        <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>

Remarques

La ligne de pied de page s’affiche en bas du FormView contrôle lorsque la FooterText propriété ou FooterTemplate est définie. Utilisez la FooterStyle propriété pour contrôler l’apparence de la ligne de pied de page dans un FormView contrôle . Cette propriété est en lecture seule ; Toutefois, vous pouvez définir les propriétés de l’objet qu’il TableItemStyle retourne. Les propriétés peuvent être définies de manière déclarative à l’aide de l’une des méthodes suivantes :

  • Placez un attribut dans la balise d’ouverture du FormView contrôle sous la forme Property-Subproperty, où Subproperty est une propriété de l’objet TableItemStyle (par exemple, FooterStyle-ForeColor).

  • Imbriquez un <FooterStyle> élément entre les balises d’ouverture et de fermeture du FormView contrôle.

Les propriétés peuvent également être définies par programmation dans le formulaire Property.Subproperty (par exemple, FooterStyle.ForeColor). Les paramètres courants incluent généralement une couleur d’arrière-plan personnalisée, une couleur de premier plan et des propriétés de police.

S’applique à

Voir aussi