FormView.FooterText Propiedad

Definición

Obtiene o establece el texto que se muestra en la fila del pie de página de un control FormView.

public:
 virtual property System::String ^ FooterText { System::String ^ get(); void set(System::String ^ value); };
public virtual string FooterText { get; set; }
member this.FooterText : string with get, set
Public Overridable Property FooterText As String

Valor de propiedad

String

Texto que se muestra en la fila del pie de página. El valor predeterminado es una cadena vacía (""), lo que indica que no se ha establecido esta propiedad.

Ejemplos

En el ejemplo siguiente se muestra cómo usar la FooterText propiedad para especificar el texto que se va a mostrar en la fila del pie de página.


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

Comentarios

La fila de pie de página se muestra en la parte inferior del FormView control cuando se establece la FooterText propiedad o FooterTemplate . Utilice la FooterText propiedad para especificar el texto que se va a mostrar en la fila del pie de página. Para controlar el estilo de la fila de pie de página, utilice la FooterStyle propiedad . Como alternativa, puede definir su propia interfaz de usuario personalizada (UI) para la fila de pie de página estableciendo la FooterTemplate propiedad en lugar de esta propiedad.

Nota

Si se establecen las FooterText propiedades y FooterTemplate , la FooterTemplate propiedad tiene prioridad.

El valor de esta propiedad, cuando se establece, se puede guardar automáticamente en un archivo de recursos mediante una herramienta de diseñador. Para obtener más información, vea LocalizableAttribute Globalización y localización.

Se aplica a

Consulte también