FormView.HeaderText プロパティ
アセンブリ: System.Web (system.web.dll 内)

Dim instance As FormView Dim value As String value = instance.HeaderText instance.HeaderText = value
[LocalizableAttribute(true)] public: virtual property String^ HeaderText { String^ get (); void set (String^ value); }
/** @property */ public String get_HeaderText () /** @property */ public void set_HeaderText (String value)
ヘッダー行に表示するテキスト。既定値は空の文字列 ("") です。この値は、このプロパティが設定されていないことを示します。

HeaderText プロパティまたは HeaderTemplate プロパティが設定されている場合、FormView コントロールの上部にヘッダー行が表示されます。HeaderText プロパティを使用して、ヘッダー行に表示するテキストを指定します。ヘッダー行のスタイルを制御するには、HeaderStyle プロパティを使用します。また、このプロパティの代わりに HeaderTemplate プロパティを設定して、ヘッダー行に独自のカスタム ユーザー インターフェイス (UI) を定義することもできます。
![]() |
---|
HeaderText プロパティと HeaderTemplate プロパティの両方が設定されている場合は、HeaderTemplate プロパティが優先されます。 |
このプロパティの値は、設定時に、デザイナ ツールを使用してリソース ファイルに自動的に保存できます。詳細については、LocalizableAttribute、ASP.NET のグローバリゼーションおよびローカリゼーション の各トピックを参照してください。

HeaderText プロパティを使用して、ヘッダー行に表示するテキストを指定する方法を次の例に示します。
<%@ Page language="VB" %> <html> <body> <form runat="server"> <h3>FormView HeaderText Example</h3> <asp:formview id="EmployeeFormView" datasourceid="EmployeeSource" allowpaging="true" datakeynames="EmployeeID" headertext="Employee Name" runat="server"> <headerstyle horizontalalign="Center" forecolor="White" backcolor="Blue"/> <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="C#" %> <html> <body> <form runat="server"> <h3>FormView HeaderText Example</h3> <asp:formview id="EmployeeFormView" datasourceid="EmployeeSource" allowpaging="true" datakeynames="EmployeeID" headertext="Employee Name" runat="server"> <headerstyle horizontalalign="Center" forecolor="White" backcolor="Blue"/> <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>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からFormView.HeaderText プロパティを検索する場合は、下記のリンクをクリックしてください。

- FormView.HeaderText プロパティのページへのリンク