FormView.FooterText Свойство

Определение

Возвращает или задает текст, отображаемый в строке нижнего колонтитула элемента управления 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

Значение свойства

Текст, отображаемый в строке нижнего колонтитула. По умолчанию используется пустая строка (""), указывающая, что это свойство не задано.

Примеры

В следующем примере показано, как использовать FooterText свойство для указания текста, отображаемого в строке нижнего колонтитула.


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

Комментарии

Строка нижнего колонтитула отображается в нижней части элемента управления, FormView если задано FooterText свойство или FooterTemplate . Используйте свойство , FooterText чтобы указать текст, отображаемый в строке нижнего колонтитула. Чтобы управлять стилем строки нижнего колонтитула, используйте FooterStyle свойство . Кроме того, можно определить собственный пользовательский интерфейс для строки нижнего колонтитула, задав FooterTemplate свойство вместо этого свойства.

Примечание

Если заданы FooterText оба свойства и FooterTemplate , FooterTemplate свойство имеет приоритет.

Значение этого свойства, если оно задано, можно автоматически сохранить в файл ресурсов с помощью средства конструктора. Дополнительные сведения см. в разделах LocalizableAttributeи Глобализация и локализация.

Применяется к

См. также раздел