asp.net.ph

LinkButton.Click Event

System.Web.UI.WebControls Namespace   LinkButton Class


Occurs when a LinkButton control on a Web Forms page is clicked.

[ VB ]
Public Event Click As EventHandler

[ C# ]
public event EventHandler Click;

[ C++ ]
public: __event EventHandler* Click;

In [ JScript ], you can handle the events defined by a class, but you cannot define your own.

Event Data

The method assigned to handle the event is passed an ImageClickEventArgs object containing data related to the Click event.

Remarks

A Click event is raised whenever a LinkButton control on a Web Forms page is clicked. This event is commonly used when no command name is associated with the LinkButton control, typically to trigger a form submit handler.

For more information about handling events, see Web Forms Events Model.

Example

The following example shows how to specify and code a simple handler for the Click event of a LinkButton control.

void showMessage ( Object src, EventArgs e ) {
   userName.Text = ( userName.Text == "" ) ? "earthling" : userName.Text;
   message.Text = "Greetings, " + userName.Text + ", welcome to ASP.NET";
}
  C# VB

 Show me 

See Also

LinkButton Members   Command Event Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

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

You can help support asp.net.ph