Bagikan melalui


SiteMapPath.CurrentNodeStyle Properti

Definisi

Mendapatkan gaya yang digunakan untuk teks tampilan untuk simpul saat ini.

public:
 property System::Web::UI::WebControls::Style ^ CurrentNodeStyle { System::Web::UI::WebControls::Style ^ get(); };
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public System.Web.UI.WebControls.Style CurrentNodeStyle { get; }
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
member this.CurrentNodeStyle : System.Web.UI.WebControls.Style
Public ReadOnly Property CurrentNodeStyle As Style

Nilai Properti

Style yang berisi pengaturan gaya untuk teks tampilan untuk simpul SiteMapPath kontrol saat ini.

Atribut

Contoh

Contoh kode berikut menunjukkan cara mengatur CurrentNodeStyleSiteMapPath kontrol secara deklaratif di halaman Formulir Web.

<%@ 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>ASP.NET Example</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"/></p>

      <p><asp:Label
            id="Label1"
            runat="server"
            Width="441px"
            Height="64px"
            AssociatedControlID="TextBox1">
                Enter your customer service issue in the space
                provided below, and we will get back to you as
                soon as possible.</asp:Label></p>

      <p><asp:TextBox id="TextBox1" runat="server"
          Width="448px" Height="96px"></asp:TextBox></p>

      <p><asp:Button id="Button1" runat="server"
          Width="112px" Text="Submit"></asp:Button></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 runat="server">
    <title>ASP.NET Example</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"/></p>

      <p><asp:Label
            id="Label1"
            runat="server"
            Width="441px"
            AssociatedControlID="TextBox1"
            Height="64px">Enter your customer service issue in the space
                          provided below, and we will get back to you as
                          soon as possible.</asp:Label></p>

      <p><asp:TextBox id="TextBox1" runat="server"
          Width="448px" Height="96px"></asp:TextBox></p>

      <p><asp:Button id="Button1" runat="server"
          Width="112px" Text="Submit"></asp:Button></p>
    </form>
  </body>
</html>

Keterangan

CurrentNodeStyle Gunakan properti untuk mengontrol tampilan teks tampilan untuk simpul jalur navigasi yang mewakili halaman yang saat ini ditampilkan. Secara default, teks tampilan adalah yang ditentukan dalam Title properti SiteMapNode dari yang mewakili halaman. Pengaturan gaya umum mencakup warna latar belakang kustom, warna latar depan, properti font, dan penspasian simpul.

Untuk SiteMapPath simpul, properti gaya digabungkan ke dalam satu gaya, dalam urutan berikut:

  1. NodeStyle

  2. CurrentNodeStyle atau, jika halaman yang ditampilkan saat ini adalah simpul akar, RootNodeStyle.

Catatan

Jika Anda mengatur gaya font simpul ke gaya coretan atau garis besar, gaya garis bawah default simpul tidak ditampilkan kecuali secara eksplisit diatur ke true.

CurrentNodeTemplate Jika properti ditentukan, CurrentNodeStyle properti diabaikan.

Berlaku untuk

Lihat juga