LoginStatus.LogoutImageUrl 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定用於登出按鈕的圖片網址。
public:
virtual property System::String ^ LogoutImageUrl { System::String ^ get(); void set(System::String ^ value); };
public virtual string LogoutImageUrl { get; set; }
member this.LogoutImageUrl : string with get, set
Public Overridable Property LogoutImageUrl As String
屬性值
一個包含登出連結圖片網址的字串。 預設值為 Empty。
範例
以下程式碼範例將屬性 LogoutImageUrl 設定為特定的影像。
<%@ Page Language="C#" autoeventwireup="False" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
void Button1_Click(Object sender, EventArgs e) {
LoginStatus1.LogoutImageUrl = String.Empty;
Button1.Visible = false;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<p>
<asp:LoginStatus id="LoginStatus1" runat="server"
LogoutImageUrl="images\logoff.png" />
</p>
<p>
<asp:Button id="Button1" onclick="Button1_Click" runat="server"
Text="Use Text" />
</p>
</form>
</body>
</html>
<%@ Page Language="VB" autoeventwireup="False" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Sub Button1_Click(sender As Object, e As EventArgs)
LoginStatus1.LogoutImageUrl = String.Empty
Button1.Visible = false
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<p>
<asp:LoginStatus id="LoginStatus1" runat="server"
LogoutImageUrl="images\logoff.png" />
</p>
<p>
<asp:Button id="Button1" onclick="Button1_Click" runat="server"
Text="Use Text" />
</p>
</form>
</body>
</html>
備註
該 LogoutImageUrl 屬性包含用於登出連結的圖片位置。 此 LogoutText 屬性被用作瀏覽器中圖片的替代文字。
若 LogoutImageUrl 為空,則 LogoutText 該屬性會被渲染為連結。