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:
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:
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.