New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Getting Started with the Telerik WebForms ImageButton

The following tutorial demonstrates how to set up a page with a RadImageButton control and attach its OnClick server event.

In the default page of a new ASP.NET AJAX-enabled Web Application, add a RadImageButton control:

ASP.NET
telerik:RadImageButton id="RadImageButton1" runat="server" Width="100px" Height="100px" Text="Image Button">
    <Image Url="image.png" />
/telerik:RadImageButton>	

The Image-Url property specifies the image that is going to be rendered in the RadImageButton. The Text property renders the specified text over the image.

To hook to the OnClick server-side event of RadImageButton, switch to Design view of Visual Studio and double-click on the RadImageButton. This will insert the following function in the code-behind file:

C#
protected void RadImageButton1_Click(object sender, EventArgs e)
{

}

This will also add OnClick="RadImageButton1_Click" to the RadImageButton's declaration. In the Click event handler, add the code that you want to be executed when the RadImageButton control is clicked.

See Also

In this article
See Also
Not finding the help you need?
Contact Support