FormView.FooterText Proprietà

Definizione

Ottiene o imposta il testo da visualizzare nella riga del piè di pagina di un controllo 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

Valore della proprietà

String

Testo da visualizzare nella riga del piè di pagina. Il valore predefinito è una stringa vuota (""), a indicare che questa proprietà non è impostata.

Esempio

Nell'esempio seguente viene illustrato come utilizzare la FooterText proprietà per specificare il testo da visualizzare nella riga del piè di pagina.


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

Commenti

La riga del piè di pagina viene visualizzata nella parte inferiore del FormView controllo quando viene impostata la FooterText proprietà o FooterTemplate . Utilizzare la FooterText proprietà per specificare il testo da visualizzare nella riga del piè di pagina. Per controllare lo stile della riga del piè di pagina, utilizzare la FooterStyle proprietà . In alternativa, è possibile definire la propria interfaccia utente personalizzata per la riga del piè di pagina impostando la FooterTemplate proprietà anziché questa proprietà.

Nota

Se vengono impostate entrambe le FooterText proprietà e FooterTemplate , la proprietà ha la FooterTemplate precedenza.

Il valore di questa proprietà, se impostato, può essere salvato automaticamente in un file di risorse usando uno strumento di progettazione. Per altre informazioni, vedere LocalizableAttribute Globalizzazione e localizzazione.

Si applica a

Vedi anche