Label Control

Label Control

Previous Home Next

 

Label Control is Used to display Text on Web Page.Text be Programable.
Properties:
1.Text:The text is display to the user.
2.Runat:Specifies that the control is a server control and set to "server".

Web Control Standered Property:
AccessKey, Attributes, BackColor, BorderColor, BorderStyle, BorderWidth, CssClass, Enabled, Font, EnableTheming, ForeColor, Height, IsEnabled, SkinID, Style, TabIndex, ToolTip.

 
  

"Label1.BorderStyle = BorderStyle.Dotted"
BorderStyle.Dotted:A dotted BorderLIne Style.

"Label1.BorderColor = System.Drawing.Color.Beige"
Set The Border Color for the border line.

 Design Code for Label
***********************************************************************
 <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Label.aspx.cs" Inherits="_Default" %>





    Label


    

 

********************************************************************* Button Code ********************************************************************* using System; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { Label1.Text = "Label Text Changed"; Label1.BorderStyle = BorderStyle.Dotted; Label1.BorderColor = System.Drawing.Color.Beige; } }
Previous Home Next