SiteMapPath.RenderCurrentNodeAsLink 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.
Indique si le nœud de navigation du site qui représente la page actuellement affichée est affiché en tant que lien hypertexte.
public:
virtual property bool RenderCurrentNodeAsLink { bool get(); void set(bool value); };
public virtual bool RenderCurrentNodeAsLink { get; set; }
member this.RenderCurrentNodeAsLink : bool with get, set
Public Overridable Property RenderCurrentNodeAsLink As Boolean
Valeur de propriété
true si le nœud qui représente la page active est affiché en tant que lien hypertexte ; sinon, false. La valeur par défaut est false.
Exemples
L’exemple de code suivant montre comment définir la RenderCurrentNodeAsLink propriété pour true rendre le nœud actuel un lien hypertexte lorsque le SiteMapPath contrôle restitue son contenu.
<%@ 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>
<title>Catalog</title>
</head>
<body>
<form id="Form1" method="post" runat="server">
<p><asp:SiteMapPath runat="server" ID="SiteMapPath1"
RootNodeStyle-Font-Bold="true"
RootNodeStyle-Font-Names="Arial Black"
RootNodeStyle-Font-Italic="True"
RootNodeStyle-ForeColor="Green"
CurrentNodeStyle-ForeColor="Orange"
PathSeparator="<::>"
PathDirection="CurrentToRoot"
RenderCurrentNodeAsLink="false"
ShowToolTips="false"/></p>
</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>
<title>Catalog</title>
</head>
<body>
<form id="Form1" method="post" runat="server">
<p><asp:SiteMapPath runat="server" ID="SiteMapPath1"
RootNodeStyle-Font-Bold="true"
RootNodeStyle-Font-Names="Arial Black"
RootNodeStyle-Font-Italic="True"
RootNodeStyle-ForeColor="Green"
CurrentNodeStyle-ForeColor="Orange"
PathSeparator="<::>"
PathDirection="CurrentToRoot"
RenderCurrentNodeAsLink="false"
ShowToolTips="false"/></p>
</form>
</body>
</html>
Remarques
Le nœud qui représente la page actuellement affichée est le SiteMap.CurrentNode. Sa Title propriété spécifie le texte à afficher pour le nœud actuel et sa Url propriété est utilisée pour créer un lien hypertexte. Par défaut, aucun lien hypertexte n’est affiché pour la page active afin d’empêcher les publications de formulaire erronées.
La valeur de cette propriété est stockée dans l’état d’affichage.