DetailsView.FooterText Propriété
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtient ou définit le texte à afficher dans la ligne de pied de page d'un contrôle DetailsView.
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
Valeur de propriété
Texte à afficher dans la ligne de pied de page. La valeur par défaut est une chaîne vide (""), ce qui signifie que cette propriété n'est pas définie.
Exemples
L’exemple de code suivant montre comment utiliser la propriété pour spécifier le FooterText texte à afficher dans la ligne de pied de page.
<%@ 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>DetailsView FooterText Example</title>
</head>
<body>
<form id="Form1" runat="server">
<h3>DetailsView FooterText Example</h3>
<asp:detailsview id="CustomerDetailView"
datasourceid="DetailsViewSource"
datakeynames="CustomerID"
autogeneraterows="true"
allowpaging="true"
footertext="Confidential"
runat="server">
<headerstyle backcolor="Navy"
forecolor="White"/>
<footerstyle forecolor="Red"
backcolor="LightBlue"
font-names="Arial"
font-size="10"
font-bold="true"/>
</asp:detailsview>
<!-- 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="DetailsViewSource" runat="server"
ConnectionString=
"<%$ ConnectionStrings:NorthWindConnectionString%>"
InsertCommand="INSERT INTO [Customers]([CustomerID],
[CompanyName], [Address], [City], [PostalCode], [Country])
VALUES (@CustomerID, @CompanyName, @Address, @City,
@PostalCode, @Country)"
SelectCommand="Select [CustomerID], [CompanyName],
[Address], [City], [PostalCode], [Country] From
[Customers]">
</asp:SqlDataSource>
</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>DetailsView FooterText Example</title>
</head>
<body>
<form id="Form1" runat="server">
<h3>DetailsView FooterText Example</h3>
<asp:detailsview id="CustomerDetailView"
datasourceid="DetailsViewSource"
datakeynames="CustomerID"
autogeneraterows="true"
allowpaging="true"
footertext="Confidential"
runat="server">
<headerstyle backcolor="Navy"
forecolor="White"/>
<footerstyle forecolor="Red"
backcolor="LightBlue"
font-names="Arial"
font-size="10"
font-bold="true"/>
</asp:detailsview>
<!-- 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="DetailsViewSource" runat="server"
ConnectionString=
"<%$ ConnectionStrings:NorthWindConnectionString%>"
InsertCommand="INSERT INTO [Customers]([CustomerID],
[CompanyName], [Address], [City], [PostalCode], [Country])
VALUES (@CustomerID, @CompanyName, @Address, @City,
@PostalCode, @Country)"
SelectCommand="Select [CustomerID], [CompanyName],
[Address], [City], [PostalCode], [Country] From
[Customers]">
</asp:SqlDataSource>
</form>
</body>
</html>
Remarques
La ligne de pied de page s’affiche en bas du DetailsView contrôle lorsque la propriété ou FooterTemplate la FooterText propriété est définie. Utilisez la propriété pour spécifier le FooterText texte à afficher dans la ligne du pied de page. Pour contrôler le style de la ligne de pied de page, utilisez la FooterStyle propriété. Vous pouvez également définir votre propre interface utilisateur personnalisée pour la ligne de pied de page en définissant la FooterTemplate propriété au lieu de cette propriété.
Notes
Si les propriétés et FooterTemplate les FooterText propriétés sont définies, la FooterTemplate propriété est prioritaire.
La valeur de celle-ci est stockée dans l’état d’affichage FooterText .
La valeur de cette propriété, quand elle est définie, peut être enregistrée automatiquement dans un fichier de ressources à l’aide d’un outil de concepteur. Pour plus d’informations, consultez LocalizableAttribute et globalisation et localisation.