ASP.NET Label 控件
定義和用法
Label 控件用於在頁面上顯示文本。 該文本是可編程的。
註釋:該控件允許您為內容應用樣式!
屬性
属性 | 描述 |
---|---|
runat | 规定该控件是一个服务器控件。必须设置为 "server"。 |
Text | 在 label 中显示的文本。 |
Web 控件標準屬性
AccessKey, Attributes, BackColor, BorderColor,
BorderStyle, BorderWidth, CssClass, Enabled, Font, EnableTheming,
ForeColor, Height, IsEnabled, SkinID, Style, TabIndex, ToolTip, Width
如需完整描述,請訪問Web控件標準屬性 。
Control Standard Properties
AppRelativeTemplateSourceDirectory, BindingContainer,
ClientID, Controls, EnableTheming, EnableViewState, ID, NamingContainer,
Page, Parent, Site, TemplateControl, TemplateSourceDirectory, UniqueID,
Visible
如需完整描述,請訪問控件標準屬性 。
實例
Label
在本例中,我們在.aspx 文件中聲明了一個Label 控件,一個TextBox 控件,以及一個Button 控件。 當用戶點擊按鈕時,會執行submit 子例程。 這個子例程會把TextBox 控件的內容拷貝到Label 控件。
Web服務器控件