FormView.FooterTemplate プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > FormView.FooterTemplate プロパティの意味・解説 

FormView.FooterTemplate プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

FormView コントロールフッター行のユーザー定義コンテンツ取得または設定します

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

<TemplateContainerAttribute(GetType(FormView))> _
Public Overridable Property
 FooterTemplate As ITemplate
Dim instance As FormView
Dim value As ITemplate

value = instance.FooterTemplate

instance.FooterTemplate = value
[TemplateContainerAttribute(typeof(FormView))] 
public virtual ITemplate FooterTemplate { get;
 set; }
[TemplateContainerAttribute(typeof(FormView))] 
public:
virtual property ITemplate^ FooterTemplate {
    ITemplate^ get ();
    void set (ITemplate^ value);
}
/** @property */
public ITemplate get_FooterTemplate ()

/** @property */
public void set_FooterTemplate (ITemplate value)
public function get FooterTemplate
 () : ITemplate

public function set FooterTemplate
 (value : ITemplate)

プロパティ
フッター行のカスタム コンテンツ含んだ System.Web.UI.ITemplate。既定値null 参照 (Visual Basic では Nothing) で、このプロパティ設定されていないことを示します

解説解説
使用例使用例

FooterTemplate プロパティ使用してフッター行に表示するカスタム テンプレート定義する方法次の例に示します

<%@ Page language="VB" %>

<script runat="server">

  Sub EmployeeFormView_ItemCreated(ByVal sender
 As Object, ByVal e As
 EventArgs)

    ' Use the FooterRow property to retrieve the footer row.
    Dim footer As FormViewRow = EmployeeFormView.FooterRow

    ' Retrieve the FooterLabel Label control from the footer row. 
    Dim footerLabel As Label = CType(footer.FindControl("FooterLabel"),
 Label)

    If footerLabel IsNot Nothing Then
      
      ' Display the current page number.
      Dim currentPage As Integer
 = EmployeeFormView.PageIndex + 1
      footerLabel.Text = "Page " & currentPage.ToString()
    
    End If
  
  End Sub
  
</script>

<html>
  <body>
    <form runat="server">
        
      <h3>FormView FooterTemplate Example</h3>
                       
      <asp:formview id="EmployeeFormView"
        datasourceid="EmployeeSource"
        allowpaging="true" 
        datakeynames="EmployeeID"
        onitemcreated="EmployeeFormView_ItemCreated"
        runat="server">
        
        <footertemplate>
          <table>
            <tr>
              <td>
                <asp:image id="LogoImage"
                  imageurl="~/Images/LogoImage.jpg"
                  runat="server"/>
              </td>
              <td>
                <asp:label id="FooterLabel"
                  runat="server"/>
              </td>
            </tr>
          </table>
        </footertemplate>
        
        <footerstyle horizontalalign="Center"
          forecolor="White"
          backcolor="LightBlue"/>
           
        <itemtemplate>
        
          <table>
            <tr>
              <td>
                <asp:image id="EmployeeImage"
                  imageurl='<%# Eval("PhotoPath") %>'
                  alternatetext='<%# Eval("LastName") %>'
 
                  runat="server"/>
              </td>
              <td>
                <h3><%# Eval("FirstName")
 %>&nbsp;<%# 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="C#" %>

<script runat="server">

  void EmployeeFormView_ItemCreated(Object sender, EventArgs e)
  {

    // Use the FooterRow property to retrieve the footer row.
    FormViewRow footer = EmployeeFormView.FooterRow;

    // Retrieve the FooterLabel Label control from the footer row. 
    Label footerLabel = (Label)footer.FindControl("FooterLabel");

    if(footerLabel != null)
    {
      // Display the current page number.
      int currentPage = EmployeeFormView.PageIndex + 1;
      footerLabel.Text = "Page " + currentPage.ToString();
    }

  }
  
</script>

<html>
  <body>
    <form runat="server">
        
      <h3>FormView FooterTemplate Example</h3>
                       
      <asp:formview id="EmployeeFormView"
        datasourceid="EmployeeSource"
        allowpaging="true" 
        datakeynames="EmployeeID"
        onitemcreated="EmployeeFormView_ItemCreated"
        runat="server">
        
        <footertemplate>
          <table>
            <tr>
              <td>
                <asp:image id="LogoImage"
                  imageurl="~/Images/LogoImage.jpg"
                  runat="server"/>
              </td>
              <td>
                <asp:label id="FooterLabel"
                  runat="server"/>
              </td>
            </tr>
          </table>
        </footertemplate>
        
        <footerstyle horizontalalign="Center"
          forecolor="White"
          backcolor="LightBlue"/>
           
        <itemtemplate>
        
          <table>
            <tr>
              <td>
                <asp:image id="EmployeeImage"
                  imageurl='<%# Eval("PhotoPath") %>'
                  alternatetext='<%# Eval("LastName") %>' 
                  runat="server"/>
              </td>
              <td>
                <h3><%# Eval("FirstName") %>&nbsp;<%#
 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 クラス
FormView メンバ
System.Web.UI.WebControls 名前空間
System.Web.UI.ITemplate
FormView.FooterStyle プロパティ
FooterText
FormView.EditItemTemplate プロパティ
FormView.EmptyDataTemplate プロパティ
HeaderTemplate
InsertItemTemplate
ItemTemplate
PagerTemplate



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「FormView.FooterTemplate プロパティ」の関連用語

FormView.FooterTemplate プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



FormView.FooterTemplate プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS