asp.net.ph

LinkButton.Text Property

System.Web.UI.WebControls Namespace   LinkButton Class


Sets or retrieves the text caption displayed in a LinkButton control.

Syntax


Inline <asp:linkbutton text = strText ... >
Script LinkButton.Text [ = strText ]

Property Value


strText String specifying the text caption displayed in the linkbutton.

The property is read/write with no default value.

Remarks

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.

Example

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>
  C# VB

 Show me 

The following examples demonstrate how to dynamically bind the Text property of LinkButton controls defined within templates.

Dynamically Generated LinkButtons
Run Sample | View Source
DataGrid DeleteCommand Event Example
Run Sample | View Source
DataGrid SelectedIndexChanged Event
Run Sample | View Source
See Also

LinkButton Members Skip Navigation Links




Previous page Back to top Next page

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note