System.Web.UI.WebControls Namespace LinkButton Class
Sets or retrieves the text caption displayed in a LinkButton control.
Inline |
<asp:linkbutton text = strText ... > |
Script |
LinkButton.Text [ = strText ] |
strText |
String specifying the text caption displayed in the linkbutton. |
The property is read/write with no default value.
Use the Text property to specify or determine the caption to display on the LinkButton control.
In certain cases, as when linkbuttons are used within templated controls, the Text property is usually obtained dynamically from a data source.
The following example shows how to initially set the Text property of a LinkButton at design time, and dynamically change the caption at run time.
<script language = "C#" runat = "server">
void chgCaption ( Object src, EventArgs e ) {
myLinkButton.Text = myTextBox.Text;
}
</script>
<script language = "VB" runat = "server">
Sub chgCaption ( src As Object, e As EventArgs )
myLinkButton.Text = myTextBox.Text
End Sub
</script> |
|
C# |
VB |
Show me
The following examples demonstrate how to dynamically bind the Text property of LinkButton controls defined within templates.
LinkButton Members