PowerWEB LiveControls for ASP.NET
Text Property
See Also  Send comments on this topic.
Dart.LiveControls Namespace > LiveLabel Class : Text Property



Gets or sets the text content of the LiveLabel control.

Syntax

Visual Basic (Declaration) 
Public Shadows Property Text As String
Visual Basic (Usage)Copy Code
Dim instance As LiveLabel
Dim value As String
 
instance.Text = value
 
value = instance.Text
C# 
public new string Text {get; set;}
C++/CLI 
public:
new property String^ Text {
   String^ get();
   void set (    String^ value);
}

Example

The following example demonstrates adding items to a Live List control dynamically, as well as updating a LiveLabel control.
Visual BasicCopy Code
'In this example, items are added to a Live List control dynamically
'The items are simply reflections of when they were added
'When one of the items is selected, a LiveLabel is updated
'LiveList1 could be a LiveListBox, LiveDropDownList, LiveRadioButtonList or LiveCheckBoxList

Private Sub LiveButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LiveButton1.Click
    'Add items dynamically in code to a list control
    'When the LiveButton is pressed, a new item is added to the list
    LiveList1.Items.Add(DateTime.Now.ToString())
End Sub

Private Sub LiveList1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LiveList1.SelectedIndexChanged
    'A LiveLabel is updated whenever an item is selected from the list
    LiveLabel1.Text = "This item was added at " + LiveList1.Items(LiveList1.SelectedIndex).ToString()
End Sub
C#Copy Code
//In this example, items are added to a Live List control dynamically
//The items are simply reflections of when they were added
//When one of the items is selected, a LiveLabel is updated
//LiveList1 could be a LiveListBox, LiveDropDownList, LiveRadioButtonList or LiveCheckBoxList

private void LiveButton1_Click(object sender, System.EventArgs e)
{
	//Add items dynamically in code to a list control
	//When the LiveButton is pressed, a new item is added to the list
	LiveList1.Items.Add(DateTime.Now.ToString());
}

private void LiveList1_SelectedIndexChanged(object sender, System.EventArgs e)
{
	//A LiveLabel is updated whenever an item is selected from the list
	LiveLabel1.Text = "This item was added at " + LiveList1.Items[LiveList1.SelectedIndex];
}

Remarks

This member is functionally equivalent to System.Web.UI.WebControls.LabelClass.Text.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

Documentation Version 4.0.2
© 2012 Dart Communications. All Rights Reserved.