Login.LoginButtonStyle Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
public:
property System::Web::UI::WebControls::Style ^ LoginButtonStyle { System::Web::UI::WebControls::Style ^ get(); };
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public System.Web.UI.WebControls.Style LoginButtonStyle { get; }
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
member this.LoginButtonStyle : System.Web.UI.WebControls.Style
Public ReadOnly Property LoginButtonStyle As Style
Nilai Properti
Referensi ke yang Style mewakili gaya tombol masuk.
- Atribut
Contoh
Contoh kode berikut menggunakan LoginButtonStyle properti untuk menentukan tampilan Login tombol masuk kontrol.
<%@ Page Language="C#" AutoEventWireup="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
Login1.LoginButtonStyle.BorderWidth = Unit.Parse("2px");
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<asp:Login id="Login1"
runat="server">
<LoginButtonStyle ForeColor="Red"
BackColor="Silver" />
</asp:Login>
</form>
</body>
</html>
<%@ Page Language="VB" AutoEventWireUp="true"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Sub Page_Load(ByVal Sender As Object, ByVal e As EventArgs)
Login1.LoginButtonStyle.BorderWidth = Unit.Parse("2px")
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<asp:Login id="Login1"
runat="server">
<LoginButtonStyle ForeColor="Red"
BackColor="Silver" />
</asp:Login>
</form>
</body>
</html>
Keterangan
LoginButtonStyle Gunakan properti untuk mengontrol tampilan tombol masuk dalam Login kontrol. Properti ini bersifat baca-saja; namun, Anda dapat mengatur properti objek yang Style dikembalikannya. Anda dapat mengatur properti ini secara deklaratif dalam formulir Property-Subproperty, di mana Subproperty mewakili properti Style kelas (misalnya, LoginButtonStyle-ForeColor). Anda dapat mengatur properti secara terprogram dalam formulir Property.Subproperty (misalnya, LoginButtonStyle.ForeColor).
Pengaturan umum mencakup warna latar belakang kustom, warna teks, dan properti font. Properti LoginButtonStyle mendefinisikan tampilan tombol masuk.
Pengaturan gaya untuk LoginButtonStyle properti digabungkan dengan pengaturan gaya untuk Login kontrol. Pengaturan apa pun yang LoginButtonStyle dibuat dalam properti mengambil alih pengaturan yang sesuai di properti Login kontrol.
Properti gaya berikut Login ini ditimpa oleh LoginButtonStyle pengaturan:
Saat Anda menggunakan templat untuk menentukan tampilan Login kontrol, LoginButtonStyle properti tidak berpengaruh.